Project

General

Profile

Actions

Bug #24389

closed

speed up typoLink function by caching domain records

Added by Simon Schaufelberger almost 14 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Category:
Caching
Target version:
Start date:
2010-12-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

there is a big TODO already in the comments, so if TYPO3 4.5 wants to be the fastest TYPO3 ever, this part of the typoLink function should be cached since it is called MANY times on a page...

$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
    'pid, domainName, forced',
    'sys_domain',
    'pid IN (' . implode(',', $targetPageRootlinePids) . ') ' . ' AND redirectTo=\'\' ' . $this->enableFields('sys_domain'),
    '',
    'sorting ASC'
);

// TODO maybe it makes sense to hold all sys_domain records in a cache to save additional DB querys on each typolink
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
    $foundDomains[] = preg_replace('/\/$/', '', $row['domainName']);
    if (!isset($firstFoundDomains[$row['pid']])) {
        $firstFoundDomains[$row['pid']] = preg_replace('/\/$/', '', $row['domainName']);
    }
    if ($row['forced'] && !isset($firstFoundForcedDomains[$row['pid']])) {
        $firstFoundForcedDomains[$row['pid']] = preg_replace('/\/$/', '', $row['domainName']);
    }
}

fileref: typo3\sysext\cms\tslib\class.tslib_content.php

(issue imported from #M16812)


Files

typolink_test.diff (3.28 KB) typolink_test.diff Administrator Admin, 2011-01-13 15:40
16812_02.diff (7.47 KB) 16812_02.diff Administrator Admin, 2011-01-13 22:25
realurl-sysdomain-cache.diff (1013 Bytes) realurl-sysdomain-cache.diff Patch for RealURL Steffen Gebert, 2011-07-18 23:45
T3X_sysdomain_cache-1_0_0-z-201111212202.t3x (11.9 KB) T3X_sysdomain_cache-1_0_0-z-201111212202.t3x Steffen Gebert, 2012-02-10 00:43
T3X_cache_backend_transient-1_0_0-z-201111212204.t3x (4.48 KB) T3X_cache_backend_transient-1_0_0-z-201111212204.t3x Steffen Gebert, 2012-02-10 00:43

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #17421: tslib_cObj::typoLink() is slow / patch to add cachingClosed2007-06-27

Actions
Related to TYPO3 Core - Feature #24888: Add a cache for typoLink()Closed2011-01-29

Actions
Related to TYPO3 Core - Bug #62556: problems with links and absRefPrefix when having multiple domains per siteClosed2014-10-30

Actions
Actions

Also available in: Atom PDF