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

Popy popy.dev at gmail.com
Tue Apr 1 18:11:20 CEST 2008


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.


--
> grtz
> Krystian
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>



-- 
Popy

Vulnerant omnes, ultima necat.

http://popy.sytes.net




More information about the TYPO3-dev mailing list