[TYPO3-dev] TypoScript: cache_period for USER objects
Peter Russ
peter.russ at 4many.net
Mon Nov 20 18:43:08 CET 2006
Oliver Hader schrieb:
> 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
I would run the SOAP as a CRON to update a local cache to make sure it's
uptodate. This could run every 10 min or less with a minimum of overhead
The extension would access this local cache as a COA_INT.
Regs. Peter.
--
Fiat lux!
Docendo discimus.
_____________________________
4Many® Services
openBC: http://www.openbc.com/go/invuid/Peter_Russ
More information about the TYPO3-dev
mailing list