Skip to content

Instantly share code, notes, and snippets.

@NamelessCoder
Created March 12, 2017 18:17
Show Gist options
  • Save NamelessCoder/b5668c5cd71ca842f2a84374ee054eab to your computer and use it in GitHub Desktop.
Save NamelessCoder/b5668c5cd71ca842f2a84374ee054eab to your computer and use it in GitHub Desktop.
Using namelesscoder/typo3-cms-multilevel-cache
<?php
/*
* Demonstrates how to configure `namelesscoder/typo3-cms-multilevel-cache` for
* added L1 (runtime) and L2 (memcached) caches on existing database-backed caches.
*
* Tip: if your site changes frequently, consider assigning a low expiration time
* on the "default_memcached" cache configuration.
*/
defined('TYPO3_MODE') or die('Access denied');
if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['default_memcached'] = [
'frontend' => \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend::class,
'backend' => \TYPO3\CMS\Core\Cache\Backend\MemcachedBackend::class,
'options' => [
'servers' => [
'127.0.0.1'
]
],
'multilevel' => [
'flush' => true,
'cascade' => true,
'prefix' => true
]
];
\NamelessCoder\MultilevelCache\CacheConfiguration::convert(
'cache_hash',
'cache_runtime',
'default_memcached',
'cache_hash'
);
\NamelessCoder\MultilevelCache\CacheConfiguration::convert(
'cache_rootline',
'cache_runtime',
'default_memcached',
'cache_rootline'
);
\NamelessCoder\MultilevelCache\CacheConfiguration::convert(
'cache_pagesection',
'cache_runtime',
'default_memcached',
'cache_pagesection'
);
\NamelessCoder\MultilevelCache\CacheConfiguration::convert(
'cache_pages',
'cache_runtime',
'default_memcached',
'cache_pages'
);
\NamelessCoder\MultilevelCache\CacheConfiguration::convert(
'extbase_object',
'cache_runtime',
'default_memcached',
'extbase_object'
);
\NamelessCoder\MultilevelCache\CacheConfiguration::convert(
'extbase_reflection',
'cache_runtime',
'default_memcached',
'extbase_reflection'
);
\NamelessCoder\MultilevelCache\CacheConfiguration::convert(
'cache_rootline',
'cache_runtime',
'default_memcached',
'cache_rootline'
);
\NamelessCoder\MultilevelCache\CacheConfiguration::convert(
'flux',
'cache_runtime',
'default_memcached',
'flux'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment