Hi Ralf,

In addition to that example code, I also do the following:

In my update/save/etc method, I have a __FUNCTION__.'.post' event fired,
which my CacheListener implementation attaches to so I can overwrite the
existing cache with new value. This way I can have an aggressive caching
strategy (TTL: 1 hour or longer), while avoiding returning stale data from
the cache.

Additionally, you can use this pattern to implement a simple multi level
cache.
I can setup a Memcached CacheListener, with TTL of 5 minutes, and also a
File CacheListener with TTL of 20 minutes. If you attach them with your
prios correctly, you will return from memcache if available, otherwise from
file cache.

Now get some sleep.

Regards,

Michael Gooden


On 16 March 2013 00:29, Ralf Eggert <[email protected]> wrote:

> LOL,
>
> Just found, that the docs show a nicely example for using the Event
> Manager for caching...
>
>
> http://zf2.readthedocs.org/en/latest/modules/zend.event-manager.event-manager.html#examples
>
> I should go to bed. Never mind my mail.
>
> Good night.
>
> Ralf
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>

Reply via email to