[TYPO3-dev] TypoScript: cache_period for USER objects

Oliver Hader oh at inpublica.de
Wed Nov 15 11:38:32 CET 2006


Hi developers,

I ran into a caching problem on a USER/USER_INT frontend plugin.
The mentioned plugin fetches weather forecast data via SOAP from a
foreign webserver and shows it on a FE page. The SOAP service updates
its forcast data every 45-60 minutes. So, I want to make sure, that
always the most current weather information is shown to the visitor, but
using a certain way of caching.

Now I have two possibilities:
1) Set the cache_period for the *whole page* to 3600 seconds
That's not really good, because the weather plugin is integrated on all
pages of the website. So every hour, the cache is going to be deleted
for the whole site.

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'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
}

If someone had an accordant problem or a better solution than handling
the caching from inside the FE plugin, please tell me your ideas. Thanks


olly
-- 
Oliver Hader
http://inpublica.de/




More information about the TYPO3-dev mailing list