Project

General

Profile

Bug #24389

Updated by Simon Schaufelberger over 2 years ago

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... 

 <pre><code class="php"> 
 $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']); 
	 } 
 } 
 </code></pre> 


 

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

 




 (issue imported from #M16812)

Back