[TYPO3-mvc] Extbase objectcache

Philipp philippwrann at gmx.at
Mon Feb 10 09:14:43 CET 2014


Hey!

For some reason i looked into my apc user cache and recognized only reflection data of entitiies is cached. Why is no real model data cached? Many many sql queries could be dropped if used properly.

You could cache a sql return like this:
model:uid = [uid:1,title:'foo',someProperty:modelb:2,someLazyChildren:null,someChildren:[modelc:1,modelc:2]]
When having a lazy property and their values are requested the cache would be updated

Complex views could reduce their requests against the database by douzens of queries. When updated a model the cacheentitiy could get flushed or updated and a tce main hook could additionally flush the entitiy cache when saving a record in the backend. Or update it.

We could add a hook that does a repository->findAll for all of our core repos and relations to create all object caches directly.

This way in most situations no queries would be neccessary to display data, only the real find methods would hit the persistence.
First-requests on pages and uncached actions would be much faster i think.

If something like this is allready implemented - i am sorry didnt find anything in my cache

my cacheconfiguration below [AdditionalConfiguration.php]

$pagecache = $systemcache = $mc = array(
	'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\ApcBackend',
	'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend',
	'options' => array('defaultLifetime' => 0)
);

$pagecache['options']['defaultLifetime'] = 2592000;
$pagecache['groups'] = array('pages,all');
$systemcache['groups'] = array('system');

$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pages'] = $pagecache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_pagesection'] = $pagecache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_hash'] = $pagecache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_rootline'] = $pagecache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['fluidchunks'] = $pagecache;

$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object'] = $systemcache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection'] = $systemcache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_datamapfactory_datamap'] = $systemcache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['pidlist'] = $systemcache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['generatedflex'] = $systemcache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['subtypes'] = $systemcache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['l10n'] = $systemcache;

$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_phpcode'] = $systemcache;
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_runtime'] = $systemcache;


More information about the TYPO3-project-typo3v4mvc mailing list