[TYPO3-dev] TypoScript: cache_period for USER objects

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed Nov 22 09:58:08 CET 2006


Ernesto Baschny [cron IT] schrieb:
> Martin Kutschker schrieb:
> 
> 
>>>>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.
>>
>>I thought of an API call for USER objects to modify the caching time of
>>the rendered page. The resulting time would be the smallest period set
>>by configuration or rendered USER objects.
> 
> In my opinion the admin could set the time himself, if he wants to, for
> that specific page, in TS directly, no need for additional features to
> do that.

Yes, but it might be nice to have the option to change the caching time 
dynamically depending on the content of a plugin. Or aplugin might give the 
admin the option to choose between different caching times depending on 
some other settings.

Eg if a plugin renders some data (cHash) it might now that the expiry time 
for different pieces of data is different (for what reason ever),

> I think the problem is that Oliver wants the whole page to be cached for
> a day, but just a tiny part of it to be updated only each hour.
> Currently he will only be able to do so by either expiring the whole
> page each hour (meaning all plugins on that page needs to be
> regenerated) or by using USER_INT, but then the whole TYPO3-framework
> has to load for each page call, and not only each hour when his plugin
> "expires".

Even for USER_INTs not the complete page is rendered every time, only 
USER_INTs, but of course the full API has to be loaded.

Masi




More information about the TYPO3-dev mailing list