Runtime cache in TYPO3

Sometime its needed to store some calculations for later use in the same php request. TYPO3 has cache for that that by default uses memory as backend.

 

$runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
$runtimeCacheIdentifier = 'foo-bar';
$runtimeCache->set($runtimeCacheIdentifier, 1000);
$test = $runtimeCache->get($runtimeCacheIdentifier);

 

Leave a Comment.