[TYPO3-core] FYI72: #11145: Starttime/endtime is not taken into account when caching

Martin Holtz typo3 at martinholtz.de
Sun May 24 12:18:32 CEST 2009


Hi Dmitry,

i tried your patch, there are a few points i think which could be changed:

In function getFirstTimeValueForRecord() could we change 
list($tableName, $pid) = explode(':', $tableDef);
to
list($tableName, $pid) = t3lib_div::explode(':', $tableDef);
So it would be possible to have an config with spaces in?

config.cache {
  55 = tt_content: 46, tt_news: 46
}

And the function get_cache_timeout() has been executed 4 times in my 
environment. Which would mean four times the same query. The function was 
called in the menu rendering process (function makeMenu). So it will depend 
on menu objects.
I think we should avoid that. But i do not know how it should be solved.


Another thing which does not work as expected is
$now = 60*(time()/60 - 1);
it should be
$now = 60*(intval(time()/60));
which is not round() but set seconds to 0.
Otherwise i got the new content a minute to late:)

In summary the patch works fine.

> Notes:
> - this issue is related to 9284 but that issue went the
at the end, francois reduced the patch to only an interface to have the 
possibility to change the cache-expires timestamp. So it would be possible 
for every extension to check in its scope. F.e. all news records are in an 
sysfolder, but the plugin selects only one category. So tt_news could check 
on its own when the cache should be come outdated and set that timestamp. 
There would be no configuration needed for tt_news then (for start- and 
stoptime).

Your Solution helps not, if an editor is allowed to put an tt_news-plugin on 
an new page. You would have to update the configuration with each new page.
Thats the same with TCEMAIN.clearCacheCmd.

But i really like to have both - your patch and patch of francois: 
9284-revised.diff 

So we have a basic solution and could make something more advanced for some 
special extensions like tt_news, commerce etc.

> other way (hooks for extension). 
after discussing that was removed.

So my +1 for this patch (perhaps with the changes i mentioned above, if not 
it would not break anything).

martin



More information about the TYPO3-team-core mailing list