ezsystems/ezpublish — pull request #292 by ballinette (2012-02-23 01:37:17+00:00)
Title: Refactoring cache-block storing directories

For now, the cache-block files are stored in {VarDir}/cache/template-block/ + a complex filename that is a crc32() of cache-block keys (cf. http://www.slideshare.net/Kaliop-slide/ez-publish-caching-mechanisms-11604985 , slides 45-46)
For example :
{VarDir}/cache/template-block/1/2/3/12345678.cache
{VarDir}/cache/template-block/5/5/5/55566678.cache
{VarDir}/cache/template-block/subtree/1/5/9/cache/1/2/3/12345678.cache

In consequence, when we update a template, it is not possible to expire only the cache-blocks that where generated by this template and we have to expire ALL cache blocks at each template update...

I suggest, with this contribution, to change the storing of cache-block files, in order to better know which cache files are generated by each templates, and then improve the way we can expire these caches.

The cache-blocks could be stored under directories depdending on siteaccess and template filenames.

For example :
{VarDir}/cache/template-block/www/extension/myextension/design/mydesign/templates/pagelayout.tpl/1/2/3/12345678.cache
{VarDir}/cache/template-block/subtree/6/0/cache/www/extension/myextension/design/mydesign/templates/pagelayout.tpl/5/5/5/55566678.cache