Project

General

Profile

Actions

Bug #43540

closed

Task #52304: Performance issues

TS is fetched from cache incorrectly sometimes

Added by Dmitry Dulepov over 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
TypoScript
Target version:
-
Start date:
2012-12-03
Due date:
% Done:

100%

Estimated time:
8.00 h
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

If $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants'] or $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup'] are set in the Install tool, cached TS will not be found in cache. This would result in TS parsing every time when there are USER_INT objects on the page. Generally it will slow down the page with USER_INT objects by at least 300% comparing to the non-cached version.

More information

When template parser processes the TS, it makes a hash to load a cached version of TS:

$this->runThroughTemplates($theRootLine);
...
$rowSumHash = md5('ROWSUM:' . serialize($this->rowSum));
$result = \TYPO3\CMS\Frontend\Page\PageRepository::getHash($rowSumHash);

There TS can be fetched from the cache. If nothing is returned, the TS is parsed and stored into the cache:

$this->generateConfig();
...
$rowSumHash = md5('ROWSUM:' . serialize($this->rowSum));
\TYPO3\CMS\Frontend\Page\PageRepository::storeHash($rowSumHash, serialize($cc['all']), 'TMPL_CONDITIONS_ALL');

Function generateConfig() prepends values from the above-mentioned variables before processing the data. The earlier called function runThroughtTemplates() does not do that. If the variables are empty, it does not make any difference and everything is cached. But if those variables are not empty (even if there is a single space), the $this->rowSum will be different in two quoted code extracts above. Thus TS will be stored with one hash value and the next request will try to retrieve it with another hash value. This means that cached TS will never be retrieved and will be always parsed.

We were able to decrease page generation from 2.88s to 0.8s by fixing the issue. 2 seconds make a huge difference in speed and load of the web server.


Related issues 1 (0 open1 closed)

Blocks TYPO3 Core - Bug #53352: Template Analyzer produces wrong resultsClosed2013-11-05

Actions
Actions

Also available in: Atom PDF