Page 1 of 1

Howto cache via entryproperties?

Posted: Wed Sep 02, 2009 8:08 pm
by onli
I don't understand the mechanism of the entryproperties-cache even though the trackexits-plugin should be an example.

In cacheable plugins, install() is used to cache the curretn state and uninstall() to empty the cache. Let's have a plugin using entry_display. If there'd be a useable cache, it should be possible to transform the code executed in the event somehow so it only gets executed from time to time. Like a man in the middle, catching the critical part of the function and returning the old result if the timeout is not over yet - and only if it's over, the expensive operation should be done.

trackexit is using 'frontend_display_cache', but that hook is never caught in the entryproperties-plugin, only executed once. How do they interact, how is it possible to cache the transormations done by a markup-plugin (or the tweet-this-button of the twitter-plugin) via entryproperties?
sincerely

Re: Howto cache via entryproperties?

Posted: Wed Sep 02, 2009 9:18 pm
by garvinhicking
Hi!

You don't happen to have my book? I think I wrote down the workings of this in depth inside the book.

The basic idea is that the plugin registers the frontend_display_cache event, do its logic there, and override any action from the usual frontend_display if the cache is not currently built.

install/uninstall is really only to update the cache onetime, for constant updates it all works through even thooks.

entryproperties cache really onjly acts on that single event, no other things are cached through entryproperties, only the markup transformations.

Regards,
GArvin

Re: Howto cache via entryproperties?

Posted: Wed Sep 02, 2009 11:23 pm
by onli
Hi Garvin
Thanks for the explanation. Think I'll have to read your book next time a question like this occurs :)