diff -r 3f5c5aa34ef7 typo3/sysext/cms/tslib/class.tslib_content.php --- a/typo3/sysext/cms/tslib/class.tslib_content.php Thu Sep 12 14:31:16 2013 +0200 +++ b/typo3/sysext/cms/tslib/class.tslib_content.php Tue Sep 17 13:05:30 2013 +0200 @@ -7299,6 +7299,7 @@ // Init vars: $allFields = 'uid,hidden,starttime,endtime,fe_group,extendToSubpages,doktype,php_tree_stop,mount_pid,mount_pid_ol,t3ver_state' . $addSelectFields; + $expires = (int)$GLOBALS['SIM_ACCESS_TIME'] + (24 * 60 * 60); // Now + 24 hours. $depth = intval($depth); $begin = intval($begin); $id = intval($id); @@ -7329,11 +7330,11 @@ $cacheEntry = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( 'treelist', 'cache_treelist', - 'md5hash = \'' . $requestHash . '\' AND ( expires > ' . $GLOBALS['EXEC_TIME'] . + 'md5hash = \'' . $requestHash . '\' AND ( expires > ' . $GLOBALS['SIM_ACCESS_TIME'] . ' OR expires = 0 )' ); - if (is_array($cacheEntry)) { + if (is_array($cacheEntry) && !$GLOBALS['TSFE']->no_cache) { // cache hit return $cacheEntry['treelist']; } @@ -7411,6 +7412,22 @@ continue; } } + + // Get expires value from pages: + // Check each page for lower starttime or endtime then current expires. + // Use it as new expires. The expires will be the time when first page will change. + // ~ Daniel Siepmann + $starttime = (int)$row['starttime']; + $endtime = (int)$row['endtime']; + if ($starttime !== 0 && $starttime < $expires && $starttime > (int)$GLOBALS['SIM_ACCESS_TIME']) { + $expires = $starttime; + } + if ($endtime !== 0 && $endtime < $expires && $endtime > (int)$GLOBALS['SIM_ACCESS_TIME']) { + $expires = $endtime; + } + unset( $starttime ); + unset( $endtime ); + // Add record: if ($dontCheckEnableFields || $GLOBALS['TSFE']->checkPagerecordForIncludeSection($row)) { // Add ID to list: @@ -7454,17 +7471,25 @@ } } + if (!$GLOBALS['TSFE']->no_cache) { + $GLOBALS['TYPO3_DB']->exec_DELETEquery( + 'cache_treelist', + 'md5hash = "' . $requestHash . '"' + ); + $GLOBALS['TYPO3_DB']->exec_INSERTquery( 'cache_treelist', array( 'md5hash' => $requestHash, 'pid' => $id, 'treelist' => $theList, - 'tstamp' => $GLOBALS['EXEC_TIME'] + 'tstamp' => $GLOBALS['EXEC_TIME'], + 'expires' => $expires, ) ); } } + } // Return list: return $theList; }