Commit 6d8b60e0 authored by Francois Suter's avatar Francois Suter
Browse files

[FEATURE] New hook for managing page cache

When pages are cached using some extra system (e.g. nc_staticfilecache)
it is useless to store these as well in whatever cache backend is used.
Thanks to a new hook, storage of a page in cache can be disabled

Change-Id: Ie2e3fb61f06a4c0c3238d0644d45895b875686ff
Fixes: #39228
Releases: 6.0
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Julien Henchoz
Tested-by: Julien Henchoz
Reviewed-by: Francois Suter
Tested-by: Francois Suter
parent 04857a5d
......@@ -2789,8 +2789,22 @@ class tslib_fe {
$cacheTimeout = $this->get_cache_timeout();
$timeOutTime = $GLOBALS['EXEC_TIME'] + $cacheTimeout;
$this->tempContent = FALSE;
$usePageCache = TRUE;
$this->setPageCacheContent($this->content, $this->config, $timeOutTime);
// Hook for deciding whether page cache should be written to the cache backend or not
// NOTE: as hooks are called in a loop, the last hook will have the final word (however each
// hook receives the current status of the $usePageCache flag)
if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'])) {
foreach ($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'] as $_classRef) {
$_procObj = t3lib_div::getUserObj($_classRef);
$usePageCache = $_procObj->usePageCache($this, $usePageCache);
// Write the page to cache, if necessary
if ($usePageCache) {
$this->setPageCacheContent($this->content, $this->config, $timeOutTime);
// Hook for cache post processing (eg. writing static files!)
if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'])) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment