[TYPO3-dev] TypoScript: cache_period for USER objects

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Nov 22 08:55:10 CET 2006


Oliver Hader schrieb:

> 2) Using a USER_INT object on the FE plugin and handle caching on my own
> At the first rendering of the plugin, the result is written to the cache
> table with a livetime of one hour. The next request to that page checks,
> if this one hour has passed by and if so, it fetches data again, renders
> the plugin HTML and writes it again to the cache.

I think that is the only and best solution. You can use TYPO3-caching
table for this:

$GLOBALS['TSFE']->sys_page->storeHash($hash, $value, 'my_plugin');

and

$GLOBALS['TSFE']->sys_page->getHash($hash);

> I'd like to know if there is a more general approach on setting caching
> for USER objects, like:
> plugin.tx_myweather_p1 = USER
> plugin.tx_myweather_p1 {
>   includeLibs = ...
>   userFunc = ...
>   cache_period = 3600
> }

Not possible, because once your plugin is cached in a page as an USER
object, TYPO3 will never know which plugin were called before the cache
for the whole page expires. The output of your plugin will just be
"merged" with the output of the page.

An "intermediate" caching mechanism, which would look like USER (expires
at a certain time stamp), but would act like USER_INT (independent of
the whole page caching) would be very useful but I afaik it doesn't exist.

Cheers,
Ernesto




More information about the TYPO3-dev mailing list