On 24-08-2008 at 11:01:10 Stefan Riehmer <[EMAIL PROTECTED]> wrote:

i thought i might share my ideas on a "special" cache, that will be refreshed when a special event is triggered.

Refreshing by triggers is pretty complicated. You usually have news in your front-end templates (perhaps even more than one), but the news items are usually changed on the admin side, so clearing of cache can't be done in normal template processing - something would have to keep track of all possible templates that may have cached that news item.

That way you could keep the latest news on your website in cache until they have been updated.

You can have cache refreshed immediately when news updates by using:

<div phptal:cache="100d per php:news.id . news.last_updated_date">

(this means that separate cache copy will be kept for every version of every news)

Caching based on last updated date (or version) handles that easily, and the only downside is that it leaves some outdated cache files behind, but it's not very hard to clean them up:
http://phptal.motion-twin.com/manual/en/split/ar07.html

--
regards, Kornel

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to