-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
ext_localconf.php
executable file
·43 lines (35 loc) · 1.5 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
declare(strict_types=1);
use SFC\Staticfilecache\Cache\RemoteFileBackend;
use SFC\Staticfilecache\Cache\StaticFileBackend;
use SFC\Staticfilecache\Cache\UriFrontend;
use SFC\Staticfilecache\Hook\DatamapHook;
use TYPO3\CMS\Core\Cache\Backend\NullBackend;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Utility\GeneralUtility;
defined('TYPO3') || die();
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = DatamapHook::class;
$extensionConfig = (array) GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('staticfilecache');
$useNullBackend = $extensionConfig['disableInDevelopment'] && Environment::getContext()->isDevelopment();
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['staticfilecache'] = [
'frontend' => UriFrontend::class,
'backend' => $useNullBackend ? NullBackend::class : StaticFileBackend::class,
'groups' => [
'pages',
'all',
],
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['remote_file'] = [
'frontend' => UriFrontend::class,
'backend' => RemoteFileBackend::class,
'groups' => [
'all',
],
'options' => [
// 'defaultLifetime' => 3600,
// 'hashLength' => 10,
],
];
// aim for cacheable frontend responses when using TYPO3's `Content-Security-Policy` behavior
$GLOBALS['TYPO3_CONF_VARS']['FE']['contentSecurityPolicy']['preferCacheableResponse'] = true;