Monday 28 February 2011 1:19:50 pm
I found a function that is useful to clean cache when you know the keys : eZContentCache::cleanup() Seems to be an old stuff but has the Cluster support. UPDATE This function will work only if you know the path or correct keys of your cache. With some tests, I've found what keys are expected by this function :
- The key string : it's the crc32 of a serilazed version of your array of keys.
- Subtree expiry : can be null
- ttl : can be null.
As the generated key string was different from what I was computing in #1, I've looked under the eztemplatefunction.php and more precisely under the templateNodeTransformation function. It appears that the keys array is composed of :
- Array of keys
- Placement : it's a string defined by the start (line / column) and the end (start / column) of the cache block inside the calling template. It looks like 83_42_122_37_extension/.../design/standard/templates/name_of_the_template.tpl.
- Siteaccess.
Then this is processed to match the crc32(serialize keys array) : <code>var/ezflow_site/cache/template-block/3/8/0/380123145654.cache</code> You may notice that the folders (3/8/0) are the extract of the beginning of the filename. So, the only way to find the cache generated is to know where it is (if not linked to a node_id). I will follow the track to find the placement that is hardcoded inside the PHP cache, maybe with a small regexp we can reach the placement.
Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou
Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas
|