[Typo3-dev] Code change template cache logic

Dennis Cheung hkdennis2k at gmail.com
Thu Dec 8 02:17:02 CET 2005


I think there is an better way in "REPLACE" statement in mysql.


On 12/7/05, Volker Hielscher <vh at dmc.de> wrote:
>
> Hi,
>
> i found an problem in the caching logic at high traffic sites. It's in the
> 3.8 source code of the class
> class.t3lib_tstemplate.php in the function start.
> it ist the position where the cache is written. first the templatecache is
> deleted and after that it is insert (again).
> Now it could be that 2 request come at the same time and the first one
> deletes the cache , the second want's to read it and found that there is
> no
> cache and brings the cache is beeing generated page to the user.
> I changed the lines and now we have no probs because the data is all time
> valid.
> Can someone checks the actual code and change the lines in core if you are
> agree with the change ?
>
> change from:
> $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pagesection',
> 'page_id='.intval($GLOBALS['TSFE']->id).' AND
> mpvar_hash='.t3lib_div::md5int($GLOBALS['TSFE']->MP));
> $GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_pagesection',
> $insertFields);
>
> to:
> $GLOBALS['TYPO3_DB']->exec_INSERTquery('cache_pagesection',
> $insertFields);
> $GLOBALS['TYPO3_DB']->exec_UPDATEquery('cache_pagesection',
> 'page_id='.intval($GLOBALS['TSFE']->id).' AND
> mpvar_hash='.t3lib_div::md5int($GLOBALS['TSFE']->MP), $insertFields);
>
> Regards
> Volker Hielscher
>
>
> _______________________________________________
> Typo3-dev mailing list
> Typo3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>




More information about the TYPO3-dev mailing list