diff --git a/.build/packages/cache_status/Classes/CacheHit.php b/.build/packages/cache_status/Classes/CacheHit.php index 598d5de..3790596 100644 --- a/.build/packages/cache_status/Classes/CacheHit.php +++ b/.build/packages/cache_status/Classes/CacheHit.php @@ -9,9 +9,8 @@ use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use TYPO3\CMS\Core\Http\NullResponse; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; -final class CacheHit implements MiddlewareInterface +final readonly class CacheHit implements MiddlewareInterface { public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { @@ -21,21 +20,14 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface return $response; } - $tsfe = $request->getAttribute('frontend.controller', $GLOBALS['TSFE'] ?? null); - if (!$tsfe instanceof TypoScriptFrontendController) { - return $response; - } - return $response->withHeader( 'X-TYPO3-Cache', - $this->hitCache($tsfe) ? 'HIT' : 'MISS' + $this->hitCache($request) ? 'HIT' : 'MISS' ); } - private function hitCache(TypoScriptFrontendController $tsfe): bool + private function hitCache(ServerRequestInterface $request): bool { - return call_user_func(\Closure::bind(function() use ($tsfe) { - return $tsfe->pageContentWasLoadedFromCache ?? $tsfe->cacheContentFlag ?? false; - }, null, $tsfe)); + return $request->getAttribute('frontend.page.parts')?->hasPageContentBeenLoadedFromCache() ?? false; } } diff --git a/.build/packages/cache_status/composer.json b/.build/packages/cache_status/composer.json index 37c2872..9b6863f 100644 --- a/.build/packages/cache_status/composer.json +++ b/.build/packages/cache_status/composer.json @@ -16,7 +16,7 @@ ], "license": "GPL-2.0+", "require": { - "typo3/cms-core": "^12.4.0 || ^13.0.0 || dev-main" + "typo3/cms-core": "^12.4 || ^13.0 || ^14.2 || dev-main" }, "autoload": { "psr-4": { diff --git a/.build/packages/cache_status/ext_emconf.php b/.build/packages/cache_status/ext_emconf.php deleted file mode 100644 index a3ce522..0000000 --- a/.build/packages/cache_status/ext_emconf.php +++ /dev/null @@ -1,29 +0,0 @@ - 'cache_status', - 'description' => '', - 'category' => 'Adds a X-TYPO3-Cache header to indicate cache hits/misses', - 'author' => '', - 'author_email' => 'ben@bnf.dev', - 'state' => 'stable', - 'internal' => '', - 'uploadfolder' => '0', - 'createDirs' => '', - 'clearCacheOnLoad' => 0, - 'version' => '1.3.4', - 'constraints' => array( - 'depends' => array( - 'typo3' => '10.4.0-13.4.99', - ), - 'conflicts' => array( - ), - 'suggests' => array( - ), - ), - 'autoload' => array( - 'psr-4' => array( - 'Bnf\\CacheStatus\\' => 'Classes', - ), - ), -); diff --git a/.build/v12/composer.json b/.build/v12/composer.json deleted file mode 100644 index 6b47a90..0000000 --- a/.build/v12/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "bnf/nginx-cache-test-site", - "repositories": [ - { - "type": "path", - "url": "../../" - }, - { - "type": "path", - "url": "../packages/*/" - } - ], - "license": "GPL-2.0+", - "require": { - "bnf/cache-status": "@dev", - "bnf/nginx-cache": "@dev", - "typo3/cms-adminpanel": "^12.4", - "typo3/minimal": "^12.4" - }, - "config": { - "allow-plugins": { - "typo3/class-alias-loader": true, - "typo3/cms-composer-installers": true - } - } -} diff --git a/.build/v13/config/system/additional.php b/.build/v13/config/system/additional.php deleted file mode 120000 index b63b141..0000000 --- a/.build/v13/config/system/additional.php +++ /dev/null @@ -1 +0,0 @@ -../../../shared/additional.php \ No newline at end of file diff --git a/.build/v13-dev/composer.json b/.build/v14-dev/composer.json similarity index 58% rename from .build/v13-dev/composer.json rename to .build/v14-dev/composer.json index d0c9d7b..72e2f4b 100644 --- a/.build/v13-dev/composer.json +++ b/.build/v14-dev/composer.json @@ -15,14 +15,14 @@ "bnf/cache-status": "@dev", "bnf/nginx-cache": "@dev", "cweagans/composer-patches": "^1.7", - "typo3/cms-adminpanel": "13.4.x-dev as 13.4.0", - "typo3/cms-backend": "13.4.x-dev as 13.4.0", - "typo3/cms-core": "13.4.x-dev as 13.4.0", - "typo3/cms-extbase": "13.4.x-dev as 13.4.0", - "typo3/cms-filelist": "13.4.x-dev as 13.4.0", - "typo3/cms-fluid": "13.4.x-dev as 13.4.0", - "typo3/cms-frontend": "13.4.x-dev as 13.4.0", - "typo3/cms-install": "13.4.x-dev as 13.4.0" + "typo3/cms-adminpanel": "14.3.x-dev as 14.2.0", + "typo3/cms-backend": "14.3.x-dev as 14.2.0", + "typo3/cms-core": "14.3.x-dev as 14.2.0", + "typo3/cms-extbase": "14.3.x-dev as 14.2.0", + "typo3/cms-filelist": "14.3.x-dev as 14.2.0", + "typo3/cms-fluid": "14.3.x-dev as 14.2.0", + "typo3/cms-frontend": "14.3.x-dev as 14.2.0", + "typo3/cms-install": "14.3.x-dev as 14.2.0" }, "config": { "allow-plugins": { diff --git a/.build/v12/config/system/additional.php b/.build/v14-dev/config/system/additional.php similarity index 100% rename from .build/v12/config/system/additional.php rename to .build/v14-dev/config/system/additional.php diff --git a/.build/v13/composer.json b/.build/v14/composer.json similarity index 82% rename from .build/v13/composer.json rename to .build/v14/composer.json index b3cf768..56a9b42 100644 --- a/.build/v13/composer.json +++ b/.build/v14/composer.json @@ -14,9 +14,9 @@ "require": { "bnf/cache-status": "@dev", "bnf/nginx-cache": "@dev", - "typo3/cms-adminpanel": "^13.1", - "typo3/cms-install": "^13.1", - "typo3/minimal": "^13.1" + "typo3/cms-adminpanel": "^14.2", + "typo3/cms-install": "^14.2", + "typo3/minimal": "^14.0" }, "config": { "allow-plugins": { diff --git a/.build/v13-dev/config/system/additional.php b/.build/v14/config/system/additional.php similarity index 100% rename from .build/v13-dev/config/system/additional.php rename to .build/v14/config/system/additional.php diff --git a/Classes/Cache/Backend/NginxCacheBackend.php b/Classes/Cache/Backend/NginxCacheBackend.php index 5818d96..a187e41 100644 --- a/Classes/Cache/Backend/NginxCacheBackend.php +++ b/Classes/Cache/Backend/NginxCacheBackend.php @@ -21,47 +21,28 @@ use TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend; use TYPO3\CMS\Core\Cache\Exception; use TYPO3\CMS\Core\Cache\Exception\InvalidDataException; +use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Core\Environment; use TYPO3\CMS\Core\Http\RequestFactory; use TYPO3\CMS\Core\Utility\GeneralUtility; -class NginxCacheBackend extends Typo3DatabaseBackend implements TransientBackendInterface +final readonly class NginxCacheBackend implements TransientBackendInterface { - /** - * Saves data in a cache file. - * - * @param string $entryIdentifier An identifier for this specific cache entry - * @param string $data The data to be stored - * @param array $tags Tags to associate with this cache entry - * @param int $lifetime Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited liftime. - * @return void - * @throws Exception if no cache frontend has been set. - * @throws InvalidDataException if the data to be stored is not a string. - */ - public function set($entryIdentifier, $data, array $tags = array(), $lifetime = null) - { - parent::set($entryIdentifier, $data, $tags, $lifetime); + private Typo3DatabaseBackend $backend; - if ($lifetime === 0) { - // unlimited is not supported by nginx - $lifetime = 24 * 60 * 60; - } + public function __construct() + { + $this->backend = new Typo3DatabaseBackend(); + } - /* Note: We use an explicit opt-in strategy to define requests as cachable. - * That means this functionality relies on the "fastcgi_cache_valid 0" - * in nginx.conf as documented in README.rst */ - header('X-Accel-Expires: ' . $lifetime); + public function set(string $entryIdentifier, mixed $data, array $tags = [], ?int $lifetime = null): void + { + $this->backend->set($entryIdentifier, $data, $tags, $lifetime); } - /** - * Removes all cache entries matching the specified identifier. - * - * @param string $entryIdentifier Specifies the cache entry to remove - * @return bool TRUE if (at least) an entry could be removed or FALSE if no entry was found - */ - public function remove($entryIdentifier) + public function remove(string $entryIdentifier): bool { - $url = parent::get($entryIdentifier); + $url = $this->backend->get($entryIdentifier); if ($url === false) { /* The key is not available. Do nothing. */ return false; @@ -69,15 +50,10 @@ public function remove($entryIdentifier) $this->purge($url); - return parent::remove($entryIdentifier); + return $this->backend->remove($entryIdentifier); } - /** - * Removes all cache entries of this cache. - * - * @return void - */ - public function flush() + public function flush(): void { /* FIXME: this won't work for cli requests. We could try do derive the site_url from * existing cache entries (using findIdentifierByTag?). @@ -89,16 +65,10 @@ public function flush() $url = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . '*'; $this->purge($url); - parent::flush(); + $this->backend->flush(); } - /** - * Removes all cache entries of this cache which are tagged by the specified tag. - * - * @param string $tag The tag the entries must have - * @return void - */ - public function flushByTag($tag) + public function flushByTag(string $tag): void { $identifiers = $this->findIdentifiersByTag($tag); foreach ($identifiers as $identifier) { @@ -107,12 +77,9 @@ public function flushByTag($tag) } /** - * Removes all cache entries of this cache which are tagged by any of the specified tags. - * - * @param string[] $tags List of tags - * @return void + * @param list $tasgs */ - public function flushByTags(array $tags) + public function flushByTags(array $tags): void { array_walk($tags, [$this, 'flushByTag']); } @@ -150,4 +117,29 @@ protected function purge(string $url): string return $content; } + + public function get(string $entryIdentifier): mixed + { + return $this->backend->get($entryIdentifier); + } + + public function has(string $entryIdentifier): bool + { + return $this->backend->has($entryIdentifier); + } + + public function collectGarbage(): void + { + $this->backend->collectGarbage(); + } + + public function setCache(FrontendInterface $cache): void + { + $this->backend->setCache($cache); + } + + public function getTableDefinitions(): string + { + return $this->backend->getTableDefinitions(); + } } diff --git a/Classes/Hooks/PageLoadedFromCacheHook.php b/Classes/Hooks/PageLoadedFromCacheHook.php deleted file mode 100644 index 585c4e7..0000000 --- a/Classes/Hooks/PageLoadedFromCacheHook.php +++ /dev/null @@ -1,122 +0,0 @@ -nginxCache = $nginxCache; - } - - /** - * v13.0 event - */ - public function handleEvent(AfterTypoScriptDeterminedEvent $event): void - { - $tsfe = $this->getTypoScriptFrontendController(); - // @todo $tsfe->pageContentWasLoadedFromCache is protected and $tsfe->isGeneratePage() is internal - if ($tsfe->isGeneratePage()) { - return; - } - - $pageCacheTags = $tsfe->getPageCacheTags(); - if (!in_array('nginx-cache-later-cacheable', $pageCacheTags, true)) { - return; - } - - $request = $this->getServerRequest(); - $uri = $this->getUri($request); - - $context = GeneralUtility::makeInstance(Context::class); - - $frontendTypoScript = $event->getFrontendTypoScript(); - $cachable = ( - $tsfe->isStaticCacheble($request) && - $context->getPropertyFromAspect('workspace', 'isOffline', false) === false && - strpos($uri, '?') === false && - $this->isAdminPanelVisible($frontendTypoScript) === false && - $request->getMethod() === 'GET' - ); - - if (!$cachable) { - return; - } - - $cacheCollector = $request->getAttribute('frontend.cache.collector'); - // => 13.3 - if ($cacheCollector !== null) { - $lifetime = $cacheCollector->resolveLifetime(); - } else { - // @todo This is ugly because $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache'] was removed in v13.0 without replacement, - // and TSFE does not provide public access to current cache expiry timestamp - $cacheExpires = \Closure::bind(static fn() => $tsfe->cacheExpires, null, TypoScriptFrontendController::class); - $lifetime = $cacheExpires() - $context->getPropertyFromAspect('date', 'timestamp'); - } - - $this->nginxCache->set(md5($uri), $uri, $pageCacheTags, $lifetime); - } - - /** - * v12 hook - */ - public function loadedFromCache(array &$params, TypoScriptFrontendController $tsfe): void - { - $row = $params['cache_pages_row'] ?? []; - $pageCacheTags = $row['cacheTags'] ?? []; - if (!in_array('nginx-cache-later-cacheable', $pageCacheTags, true)) { - return; - } - - /* We populate config into $TSFE as we do need it for the isAdminPanelVisisble check. - * $TSFE does the same after this hook (pageLoadedFromCache). So it should be safe. */ - $tsfe->config = $row['cache_data'] ?? ''; - - $request = $this->getServerRequest(); - $uri = $this->getUri($request); - - $context = GeneralUtility::makeInstance(Context::class); - $cachable = ( - $tsfe->isStaticCacheble() && - $context->getPropertyFromAspect('workspace', 'isOffline', false) === false && - strpos($uri, '?') === false && - $this->isAdminPanelVisible() === false && - $request->getMethod() === 'GET' - ); - - if (!$cachable) { - return; - } - - $lifetime = $row['expires'] - $context->getPropertyFromAspect('date', 'timestamp'); - $this->nginxCache->set(md5($uri), $uri, $pageCacheTags, $lifetime); - } -} diff --git a/Classes/Hooks/RequestAwareTrait.php b/Classes/Hooks/RequestAwareTrait.php deleted file mode 100644 index 2833b3d..0000000 --- a/Classes/Hooks/RequestAwareTrait.php +++ /dev/null @@ -1,74 +0,0 @@ -getServerRequest(); - return $request->getAttribute('frontend.controller', $GLOBALS['TSFE'] ?? null); - } - - protected function isAdminPanelVisible(?FrontendTypoScript $frontendTypoScript = null): bool - { - $frontendTypoScript ??= $this->getServerRequest()->getAttribute('frontend.typoscript'); - return ( - ExtensionManagementUtility::isLoaded('adminpanel') && - StateUtility::isActivatedForUser() && - ((new Typo3Version())->getMajorVersion() <= 12 ? StateUtility::isActivatedInTypoScript() : ($frontendTypoScript->getConfigArray()['admPanel'] ?? false)) && - StateUtility::isHiddenForUser() == false - ); - } - - protected function getUri(ServerRequestInterface $request): string - { - $normalizedParams = $this->getNormalizedParams($request); - if ($normalizedParams !== null) { - return $normalizedParams->getRequestUrl(); - } - - return (string)$request->getUri(); - } - - protected function getNormalizedParams(ServerRequestInterface $request): ?NormalizedParams - { - $normalizedParams = $request->getAttribute('normalizedParams'); - if ($normalizedParams instanceof NormalizedParams) { - return $normalizedParams; - } - return null; - } -} diff --git a/Classes/Hooks/SetPageCacheHook.php b/Classes/Hooks/SetPageCacheHook.php deleted file mode 100644 index 5cca0e8..0000000 --- a/Classes/Hooks/SetPageCacheHook.php +++ /dev/null @@ -1,100 +0,0 @@ -getIdentifier() !== 'pages') { - return; - } - - // Ignore cached 404 page - if (in_array('errorPage', $tags, true)) { - return; - } - - // EXT:redirects adds none-page content to cache_pages, ignore this. - $ignoredIdentifiers = [ - 'redirects', - ]; - foreach ($ignoredIdentifiers as $ignored) { - if (str_contains($entryIdentifier, $ignored)) { - return; - } - } - - $request = $this->getServerRequest(); - $uri = $this->getUri($request); - - $temp_content = (isset($data['temp_content']) && $data['temp_content']); - $tsfe = $this->getTypoScriptFrontendController(); - - $context = GeneralUtility::makeInstance(Context::class); - $isLaterCachable = ( - $temp_content === false && - $tsfe !== null && - $tsfe->isStaticCacheble($request) && - $context->getPropertyFromAspect('workspace', 'isOffline', false) === false && - in_array('nginx_cache_ignore', $tags, true) === false - ); - - $cachable = ( - $isLaterCachable && - !str_contains($uri, '?') && - $this->isAdminPanelVisible() === false && - $request->getMethod() === 'GET' - ); - - if ($cachable && $this->container !== null) { - // @var FrontendInterface $nginxCache - $nginxCache = $this->container->get('cache.nginx'); - $nginxCache->set(md5($uri), $uri, $tags, $lifetime); - } - - if ($isLaterCachable) { - /* We store this marker here, in case we ever loose the cache in nginx. - * In that case TYPO3 is requested and retrieves the cached content from cache_pages. - * For that case we install a PageLoadedFromCache hook(v12)/event(13.0), that uses these data - * to decide a) whether data should be cached - */ - $params['variable']['cacheTags'][] = 'nginx-cache-later-cacheable'; - } - } -} diff --git a/Classes/Middleware/CacheInterceptor.php b/Classes/Middleware/CacheInterceptor.php new file mode 100644 index 0000000..562fc8b --- /dev/null +++ b/Classes/Middleware/CacheInterceptor.php @@ -0,0 +1,124 @@ +handle($request); + $uri = $this->getNormalizedParams($request)->getRequestUrl(); + $cachable = ( + $request->getMethod() === 'GET' && + !str_contains($uri, '?') && + $this->getCacheInstruction($request)->isCachingAllowed() && + !$this->getPageParts($request)->hasNotCachedContentElements() && + !$this->context->getAspect('frontend.user')->isUserOrGroupSet() && + !$this->context->getPropertyFromAspect('workspace', 'isOffline', false) && + !$this->isAdminPanelVisible($request) + ); + + if (!$cachable) { + return $response; + } + + $lifetime = $this->getCacheDataCollector($request)->resolveLifetime(); + $pageCacheTags = array_map( + static fn(CacheTag $cacheTag) => $cacheTag->name, + $this->getCacheDataCollector($request)->getCacheTags() + ); + + $this->nginxCache->set(md5($uri), $uri, $pageCacheTags, $lifetime); + + /* Note: We use an explicit opt-in strategy to define requests as cachable. + * That means this functionality relies on the "fastcgi_cache_valid 0" + * in nginx.conf as documented in README.rst */ + return $response->withHeader( + 'X-Accel-Expires', + (string)($lifetime > 0 + ? $lifetime + // unlimited is not supported by nginx + : 24 * 60 * 60) + ); + } + + private function getCacheInstruction(ServerRequestInterface $request): CacheInstruction + { + return $request->getAttribute('frontend.cache.instruction') + ?? throw new \RuntimeException('frontend.page.parts attribute is required', 1775059553); + } + + private function getPageParts(ServerRequestInterface $request): PageParts + { + return $request->getAttribute('frontend.page.parts') + ?? throw new \RuntimeException('frontend.page.parts attribute is required', 1775059554); + } + + private function getCacheDataCollector(ServerRequestInterface $request): CacheDataCollector + { + return $request->getAttribute('frontend.cache.collector') + ?? throw new \RuntimeException('frontend.cache.collector attribute is required', 1775059555); + } + + private function getFrontendTypoScript(ServerRequestInterface $request): FrontendTypoScript + { + return $request->getAttribute('frontend.typoscript') + ?? throw new \RuntimeException('frontend.typoscript attribute is required', 1775059556); + } + + protected function getNormalizedParams(ServerRequestInterface $request): ?NormalizedParams + { + return $request->getAttribute('normalizedParams') + ?? throw new \RuntimeException('frontend.typoscript attribute is required', 1775059557); + } + + private function isAdminPanelVisible(ServerRequestInterface $request): bool + { + return ( + $this->packageManager->isPackageActive('adminpanel') && + StateUtility::isActivatedForUser() && + ($this->getFrontendTypoScript($request)->getConfigArray()['admPanel'] ?? false) && + StateUtility::isHiddenForUser() == false + ); + } +} diff --git a/Configuration/RequestMiddlewares.php b/Configuration/RequestMiddlewares.php new file mode 100644 index 0000000..e6ddcf6 --- /dev/null +++ b/Configuration/RequestMiddlewares.php @@ -0,0 +1,16 @@ + [ + 'bnf/nginx-cache/cache-interceptor' => [ + 'target' => \Bnf\NginxCache\Middleware\CacheInterceptor::class, + 'after' => [ + 'typo3/cms-frontend/prepare-tsfe-rendering', + 'typo3/cms-frontend/shortcut-and-mountpoint-redirect', + ], + 'before' => [ + 'typo3/cms-core/response-propagation', + ], + ], + ], +]; diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 12931e4..bb366df 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -12,14 +12,3 @@ services: class: TYPO3\CMS\Core\Cache\Frontend\FrontendInterface factory: ['@TYPO3\CMS\Core\Cache\CacheManager', 'getCache'] arguments: ['nginx'] - - Bnf\NginxCache\Hooks\SetPageCacheHook: - public: true - - Bnf\NginxCache\Hooks\PageLoadedFromCacheHook: - public: true - tags: - - name: event.listener - method: handleEvent - arguments: - $nginxCache: '@cache.nginx' diff --git a/Makefile b/Makefile index 14c33da..d21614d 100644 --- a/Makefile +++ b/Makefile @@ -7,25 +7,17 @@ EXTKEY = $(notdir $(shell pwd)) check: ddev stop --remove-data --omit-snapshot ddev start - $(MAKE) check-12 - ddev restart - $(MAKE) check-13 + $(MAKE) check-14 - -check-12: .build/assert-1.1.sh - ddev clean-db - ddev exec .build/setup-typo3.sh v12 - ddev exec .build/run-tests.sh v12 - -check-13: .build/assert-1.1.sh +check-14: .build/assert-1.1.sh ddev clean-db - ddev exec .build/setup-typo3.sh v13 - ddev exec .build/run-tests.sh v13 + ddev exec .build/setup-typo3.sh v14 + ddev exec .build/run-tests.sh v14 check-main: .build/assert-1.1.sh ddev clean-db - ddev exec .build/setup-typo3.sh v13-dev - ddev exec .build/run-tests.sh v13-dev + ddev exec .build/setup-typo3.sh v14-dev + ddev exec .build/run-tests.sh v14-dev t3x-pack: git archive --worktree-attributes -o $(EXTKEY)_`git describe --always --tags`.zip HEAD diff --git a/composer.json b/composer.json index 7df3efb..6a4c61e 100644 --- a/composer.json +++ b/composer.json @@ -17,18 +17,15 @@ ], "license": "GPL-2.0+", "require": { - "typo3/cms-core": "^12.4.0 || ^13.0", - "typo3/cms-frontend": "^12.4.0 || ^13.0", - "typo3/cms-backend": "^12.4.0 || ^13.0" + "typo3/cms-core": "^14.2", + "typo3/cms-frontend": "^14.2", + "typo3/cms-backend": "^14.2" }, "autoload": { "psr-4": { "Bnf\\NginxCache\\": "Classes" } }, - "replace": { - "typo3-ter/nginx-cache": "self.version" - }, "extra": { "typo3/cms": { "extension-key": "nginx_cache" diff --git a/ext_emconf.php b/ext_emconf.php index 3ea08c7..c0afc2f 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -9,7 +9,7 @@ 'version' => '3.0.3', 'constraints' => [ 'depends' => [ - 'typo3' => '12.4.0-13.4.99', + 'typo3' => '14.2.0-14.3.99', ], 'conflicts' => [ ], diff --git a/ext_localconf.php b/ext_localconf.php index 44ae2bf..3d0d018 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -3,10 +3,7 @@ defined('TYPO3') or die(); use Bnf\NginxCache\Cache\Backend\NginxCacheBackend; -use Bnf\NginxCache\Hooks\PageLoadedFromCacheHook; -use Bnf\NginxCache\Hooks\SetPageCacheHook; use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend; -use TYPO3\CMS\Core\Information\Typo3Version; $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['nginx'] = [ 'frontend' => VariableFrontend::class, @@ -16,11 +13,3 @@ 'all' ], ]; - -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_variablefrontend.php']['set']['nginx_cache'] = - SetPageCacheHook::class . '->set'; - -if ((new Typo3Version())->getMajorVersion() <= 12) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache']['nginx_cache'] = - PageLoadedFromCacheHook::class . '->loadedFromCache'; -}