[TYPO3-dev] Hook for clearing cache_pagesection

Christian Kuhn lolli at schwarzbu.ch
Fri Jan 22 22:24:49 CET 2010


Hey,

Manfred Mirsch wrote:
> Now I am searching for a way to clean the cache of a content element
> during the rendering process when i recognize that curl has to reload
> the foreign page.
> 
> I found several hooks in tslib_fe.php but no one really worked for me.
> I tried clearing cache by deleting the corresponding entries in
> database-tables 'cache_pages' and 'cache_pagesection' but this has only
> effect for the next page hit.

You are sure, we are talking about cache_pagesection and not cache_pages?

If cache_pages:

Simple solution:
Use a USER_INT for your "get content from other site" plugin.

Tricky solution:
Maybe you could use determineId-PostProc (just guessing)? At this point
the page id is already calculated, but the page is not retrieved from
cache, yet. If this doesn't work out, a new hook just before cache get
might be a useful feature for the core anyway ...
You could do this: Use the caching framework of 4.3 and tag your "shows
content from other site" pages with some tag. Find some (fast) logic to
determine if your upstream page changed and drop
cachingframework_cache_pages entries with mentioned tag. Cache lookup
will then have a cache miss and your page is recalculated. Your "get
content from other site" plugin is called, sets the tag and a new cache
entry.
For more information on TYPO3 caching and behavior you could take a look
at documentation of enetcache [2], even if it's not designed to handle
your specific use case.


> Actually I didn't find the part in index_ts.php or tslib_fe.php where
> the desicion is made,
> if the page content is taken from cache or rendered.

Take a look at [1]

[1]http://buzz.typo3.org/people/stucki/article/typo3-frontend-rendering-explained/
[2]http://forge.typo3.org/projects/show/extension-enetcache

Greetings
Christian




More information about the TYPO3-dev mailing list