[TYPO3-dev] better cache management in extensions (tt_news example)

Krystian Szymukowicz t33kRE.MO.VE. at RE.MO.VE.prolabium.com
Thu Apr 3 10:56:52 CEST 2008


Popy wrote:
> 2008/4/1, Krystian Szymukowicz <"t33kRE.MO.VE."@re.mo.ve.prolabium.com>:
>> Popy wrote:
>>> There's already something of this kind implemented in pp_lib :)
>>>
>>
>> Can you describe the idea of your cache management system?
> 
> The idea is :
> Each time an item is rendered on the frontend and cached, a kind of relation
> is created (by the plugin) between the item and the page cache hash.
> Also it is possible to clear the related caches.
> 
> I'm still searching/working on improvements. The way the relations are
> stored is not very pretty because I made a bad choice, and for now there's
> nothing automatic.
> 
> 
> 
> Is there any extension in TER that uses this?
> 
> 
> pp_forum
> 
> 
> The procedure is :
> 1) During  plugin init, call $this->loadHashList(true);, wich loads the
> relations
> 
> 2) While displaying an item (like, a category, or a new), call
> $this->storeHash($param);, where $param is the record identifier (usually,
> something like array($table => $uid))
> Note that you can choose how to handle relations. You call it only for the
> category displayed, or to every new displayed in the "category list mode"
> (still in case of a news plugin)
> 
> 3) Before the plugin return its content, call $this->saveHashList(true),
> wich will save the relations.
> 
> Then, to clear caches, use the function clearHashList($param) where $param
> is the same $param identifier you used at step 2. Every stored caches will
> be cleared
> The problem is that this function is in the plugin for now. I have to
> redesign the storage table & provide some static functions, instead of
> plugin side functions.
> 
> 

Tnx for explanation - I had similar idea too. I will give it a try but a 
little bit later.

Currently I'am working on extension for better cache management in 
tt_news. It will clear cache on basis of page cache search (I wonder how 
fast it will be) but it will be not so hard to modify it to use your API.

--
grtz
Krystian




More information about the TYPO3-dev mailing list