[TYPO3-dev] TypoScript: cache_period for USER objects

Bernd Wilke t3ng at bernd-wilke.net
Thu Nov 23 11:55:49 CET 2006


"Oliver Hader" <oh at inpublica.de> schrieb im Newsbeitrag 
news:mailman.1.1163587076.15804.typo3-dev at lists.netfielders.de...
> 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.

I think you might get wrong results if you use a cache with a valid-period.

Any page build in TYPO3-Cache is build on the first call.

example:
attempt: your weather data is refreshed at each full hour ( XX:00 )
         you set cacehtime to 1 hour

if no user visited your site after 10:00 until 10:51 this first user will 
build up a cached page, which is valid until 11:51.

result:
every visiter gets this page until 11:51. the first visitor after that will 
create a new page, valid for the next hour.

worst case: the next visitor calls the page just befor data-refresh (xx:59).

best solution for me:
an uncached extension, which handles its own cache:
if (no valid data is in own cache) {
    compute data and store it for representation with a timemark until which 
this data is valid.
}
show data from own cache

Bernd 






More information about the TYPO3-dev mailing list