[TYPO3-english] cache in extensions

Morten Hagh morten at hagh.dk
Tue Feb 7 13:18:08 CET 2012


Hi list,

I followed this guide http://danosipov.com/blog/?tag=memcached but I have
a little problem as I can't get anything in the two tables:

tx_rtmur_cache
tx_rtmur_cache_tags

Them being empty, tells me that I have missed something.

I have this in my localconf.php

$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rtmur'] = array(
   'frontend' => 't3lib_cache_frontend_VariableFrontend',
   'backend' => 't3lib_cache_backend_MemcachedBackend',
   'options' => array(
      'servers' => array('localhost:11211'),
   )
);

and this in ext_localconf.php

// If cache is not already defined, define it
if
(!is_array($TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rtmur']))
{
   $TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rtmur'] =
array(
      'backend' => 't3lib_cache_backend_DbBackend',
      'options' => array(
         'cacheTable' => 'tx_rtmur_cache',
         'tagsTable' => 'tx_rtmur_cache_tags',
      )
   );
}

and finally this in my extension:

if (TYPO3_UseCachingFramework) {
			try {
      			$GLOBALS['typo3CacheFactory']->create(
         		'rtmur',
         		't3lib_cache_frontend_VariableFrontend',
         		$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rtmur']['backend'],
         		$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['rtmur']['options']
      		);
			} catch(t3lib_cache_exception_DuplicateIdentifier $e) { }
			// Initialize the cache
			try {
				$this->cache = $GLOBALS['typo3CacheManager']->getCache('rtmur');
			} catch(t3lib_cache_exception_NoSuchCache $e) { }
		}
	}

I might have misunderstood the guide completely.

/Morten Hagh


More information about the TYPO3-english mailing list