hi
There does not seem to be a huge amount of information out there regarding partial caching so here are a few notes from my experiences.
1) You can manually delete the cache manually from disk by deleting the contents of /tmp/silverstripe-name-of-install-path/cache
2) debug_profile is your friend. This shows the the length of time a method takes and how often it was called, those with high values are often a good candidate for partial caching.
As an example let us consider a template for a sitemap, which has to iterate through the entire site tree in order to form the sitemap.
Without caching the debug profile shows this:
============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
1 525.6441 ms (73.30 %) obj.SiteMap
1 132.5247 ms (18.48 %) all_execution
2 28.6548 ms (4.00 %) SSViewer::process
1 6.3190 ms (0.88 %) obj.Menu
2 5.7511 ms (0.80 %) obj.LastEdited
1 2.8870 ms (0.40 %) obj.Content
1 2.8121 ms (0.39 %) obj.Title
2 2.3530 ms (0.33 %) obj.TheCurrentLocale
1 2.3081 ms (0.32 %) SSViewer::process - compile
3 1.3778 ms (0.19 %) obj.Aggregate
1 0.9809 ms (0.14 %) DB::connect
1 0.7699 ms (0.11 %) main.php init
2 0.4091 ms (0.06 %) obj.ID
2 0.3302 ms (0.05 %) obj.ContentLocale
1 0.3102 ms (0.04 %) obj.Level
1 0.3080 ms (0.04 %) obj.Form
3 0.3011 ms (0.04 %) obj.IsLive
1 0.2770 ms (0.04 %) obj.isImageItem
1 0.2739 ms (0.04 %) obj.SectionPage
1 0.1020 ms (0.01 %) obj.Layout
2 0.0880 ms (0.01 %) Requirements::includeInHTML
1 0.0250 ms (0.00 %) unprofiled
2.3386 ms (0.33 %) Missed
============================================================================
717.1459 ms (100.00 %) OVERALL TIME
============================================================================
With caching, it is a different story:
============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
1 139.0479 ms (75.54 %) all_execution
2 21.5411 ms (11.70 %) SSViewer::process
1 9.3021 ms (5.05 %) obj.Menu
2 3.9222 ms (2.13 %) obj.LastEdited
2 2.2361 ms (1.21 %) obj.TheCurrentLocale
3 1.5733 ms (0.85 %) obj.Aggregate
1 0.9320 ms (0.51 %) DB::connect
1 0.7181 ms (0.39 %) main.php init
1 0.5250 ms (0.29 %) obj.Form
1 0.4790 ms (0.26 %) obj.SectionPage
2 0.4361 ms (0.24 %) obj.ContentLocale
2 0.4070 ms (0.22 %) obj.ID
1 0.3579 ms (0.19 %) obj.Level
3 0.3407 ms (0.19 %) obj.IsLive
1 0.3231 ms (0.18 %) obj.isImageItem
1 0.1051 ms (0.06 %) obj.Layout
2 0.0911 ms (0.05 %) Requirements::includeInHTML
1 0.0269 ms (0.01 %) unprofiled
1.6961 ms (0.92 %) Missed
============================================================================
184.0608 ms (100.00 %) OVERALL TIME
============================================================================
You can see here that the caching has ensured that the Site Tree was not traversed in the database, saving half a second.
Incidentally the template used was
<% cached 'Sitemap', Aggregate(Page).Max(LastEdited) %>
<h1 class="head">$Title</h1>
<span class="txt">
$Content
<div id="sitemap">
$SiteMap
</div>
</span><!--/txt-->
<% end_cached %>
$Form
Each time a page is saved, the sitemap cache is invalidated. Thus the sitemap is always rendered up to date, but if no editing is occurring then a cached version will be served.
3) Make sure your cache key contains all the input parameters. For example I initially cached a search result page by query, but then page 1, page 2 etc are the same.
4) Don't put $Form inside a cached/end_cached construct. i did this with the Page class template and then could not log in.
Cheers
Gordon