Cache invalidation is a pain.
Posted on 2008-02-06 01:24:21 EET.
Those of you who have played more or less with content or object caching have probably ran into the issue of invalidation. The invalidation is not the exact issue but how do you keep account what has been used and where?
It's hard! In MIDCOM 2.8 page level content caching works in GUID level. This works automatically and it's reliable. For some time I've been thinking about a manual caching for special cases.
What if you have a list of objects that have been built with many expensive database queries. Then one object changes and you don't want to build the whole list from scratch. Or another case is that you want, for some reason, do things on your own.
Zend framework's caching has an interesting implementation of caching API. It uses tagging. This is an interesting concept since it enables developer to make an easy invalidation of cache entries that are related for some purpose.
It should be also noted that it enables quite flexible way to deal with different granularities of caching.
But as usual these implementation do not come for free. As you move to more fine granularity in caching more work has to be done for bookkeeping. It's hard to find the sweet spot,
It's hard! In MIDCOM 2.8 page level content caching works in GUID level. This works automatically and it's reliable. For some time I've been thinking about a manual caching for special cases.
What if you have a list of objects that have been built with many expensive database queries. Then one object changes and you don't want to build the whole list from scratch. Or another case is that you want, for some reason, do things on your own.
Zend framework's caching has an interesting implementation of caching API. It uses tagging. This is an interesting concept since it enables developer to make an easy invalidation of cache entries that are related for some purpose.
It should be also noted that it enables quite flexible way to deal with different granularities of caching.
But as usual these implementation do not come for free. As you move to more fine granularity in caching more work has to be done for bookkeeping. It's hard to find the sweet spot,
