forked from b13/proxycachemanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext_localconf.php
executable file
·26 lines (22 loc) · 1.53 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
defined('TYPO3_MODE') or die();
if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_proxy'] ?? null)) {
$configuration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)->get('proxycachemanager');
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tx_proxy'] = [
'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
'backend' => \B13\Proxycachemanager\Cache\Backend\ReverseProxyCacheBackend::class,
'options' => [
'defaultLifetime' => 0, // @todo: should be not "infinite" but rather set to whatever the proxy settings are
'reverseProxyProvider' => $configuration['reverseProxyProvider'] ?? \B13\Proxycachemanager\Provider\CurlHttpProxyProvider::class,
'reverseProxyEndpoints' => $configuration['reverseProxyEndpoints'],
],
// setting the pages group makes sure that when the page cache is cleared, that this cache is cleared as well
'groups' => ['pages', 'proxy'],
];
}
// Hook for adding any cacheable frontend URL to our proxy cache
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache']['tx_proxycachemanager'] =
\B13\Proxycachemanager\Hook\FrontendHook::class;
// Hook for adding an additional cache clearing button
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions']['tx_proxycachemanager'] =
\B13\Proxycachemanager\Controller\CacheController::class;