[TYPO3-core] RFC: Bug 4581: Duplicate entry on cache_pagesection on reloading twice

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Jan 25 08:51:07 CET 2007


Michael Stucki wrote: on 25.01.2007 01:09:

>> Maybe the solution here is not even save anything to cache_pagesection
>> if we are going to throw it away in 1 second anyway...

> No, but it helps to reduce the chance that this may happen to a minimum. Good 
> idea! So I just finished the attached patch, which seems to work quite well.
> 
> Since this seems to be quite tricky to follow easily, here is a rough 
> explanation of the workflow: (current and new - the patch won't change this)
> 
> 1. cache_pagesection is only written when the template parser is started
> 
> 2. the template parser is only started if $TSFE->config is not an array
> 
> 3. $TSFE->config is only set if the following condition matches:
> 
> 	if ($this->all && !$this->no_cache && !$this->headerNoCache())	{
> 
> 4. $this->all = the template of this condition combination exists in the cache
> 
> So far this means, that the template parser is only started in two situations:
> 
> - no_cache (or headerNoCache) is forced
> - or there is no data in the cache
> 
> However, the cache should only be written in the latter situation. So this 
> patch will change the following behaviours:
> 
> As soon as $GLOBALS['TSFE']->no_cache is true, the following operations will 
> be skipped:
> 
> - TStemplate::start() (the template parser) will not read from
>   cache_pagesection
> 
> - It also won't write anything into the cache for the same reason

This doesn't seem to be working. I still get the "duplicate entry"
problem, having config.no_cache=1 in my TypoScript. At the point you
reach line 358 of class.t3lib_tstemplate.php, $GLOBALS['TSFE']->no_cache
is set to "0" in my situation.

Note that I didn't set no_cache in the $_GET headers, but have it set in
my TS-setup. Maybe this hasn't been parsed at that point?


Cheers,
Ernesto


More information about the TYPO3-team-core mailing list