Hello, 

i thought i might share my ideas on a "special" cache, that will be refreshed 
when a special event
is triggered. That way you could keep the latest news on your website in cache 
until they have been
updated.

The basic idea is that you'll add some __id__ to each cache-area and keep this 
cache forever.
The user can decide himself when to refresh using a static function like 
PHPTAL:refresh("news_120").
This function will simply clean up all cache-files matching this pattern.

Nevertheless i didn't had that good of an idea, so i - bad part - extended that 
phptal-namespace with
some attribute called phptal:refresh. See the following example.
Template:
<b phptal:refresh="keyword" tal:content="php:time()">cache this until certain 
event will remove cache
file, so data in cache will have to be renewed</b>
PHPTAL:
$tpl->keyword="news_120";

This example will output something like the following:
<b>12983128312</b>

The data "12983128312" will be produced only once an then kept till 
PHPTAL:refresh("news_120") OR
PHPTAL:refresh("news") is called.

Are there ideas on this subject out there? Or existing workarounds for this 
kind of caching?

Awaiting you feedbacks. Thanks

Stefan

_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to