[TYPO3-dev] clear specified cache_pagesection

Steffen Kamper info at sk-typo3.de
Tue Jan 6 12:48:13 CET 2009


Hi Steffen,

Steffen Gebert schrieb:
> Steffen Kamper wrote:
>> how do i clear a specific entry from page_section having page id and
>> GET-vars?
> 
> Hi Steffen,
> 
> this sounds like the things that the extensions tt_news_cache_clearlike and tt_news_cache do - clear specific entries from cache tables.
> 
> As they don't work with the new caching framework this is the thread I have to monitor, right? Sounds like tags can help here...
> 

the normal way to clear cache is to do it with tce. So clearing single 
page cache isn't difficult

$tce = t3lib_div::makeInstance('t3lib_TCEmain');
$tce->clear_cacheCmd($pid);

instead of giving a pid it's also possible to use keywords like
$tce->clear_cacheCmd('pages');
$tce->clear_cacheCmd('all');
$tce->clear_cacheCmd('temp_CACHED');

tce uses the new cache-framework to do the clearing.

What i want is to be more specific. For example, if you change a news 
item you only want to clear the cache for this item, not for complete 
page. So you would like to know which entry of page_sections is the 
right holding this view. The tag is somehow calculated with the pid ad 
the GETvars, so i' looking for this tag. Knowing the tag makes it easy 
to clear it with
$GLOBALS['typo3CacheManager']->flushCachesByTag($tag)

and this is part of the new cache framework.

Imho it would make sense to have a wrapper function for it, eg
$GLOBALS['typo3CacheManager']->calculateTag($pid, array $GET)

vg Steffen




More information about the TYPO3-dev mailing list