invalidating a set of entries
tobias.luetke at gmail.com
Thu Oct 4 13:27:16 UTC 2007
We use option 2 very successfully:
On 10/4/07, Venkatesh KS <venkatesh.ks at gmail.com> wrote:
> We have a requirement to invalidate a set of cache entries based on a prefix
> (or a tag)
> I thought of the following approaches
> 1. Tag each entry (as discussed in the other thread) with a gen count and
> once we want to invalidate
> incr the global gen count. While looking up, if the gen count of the entry
> is less than the global gen count
> for a given prefix (or tag) then return null.
> 2. Each key also has a gen count as a part of the key (for a given prefix or
> a tag). When we want to invalidate
> then bump up the gen count in the client. So all subsequent lookups will
> 3. Write a regex engine (or a tag feature) which will go an invalidate all
> the entries matching a prefix or a tag.
> Options 1 and 2 are easy to implement but the drawback is that because of
> the way ejections work (LRU)
> we may let these invalid content hang around and eject out valid content.
> Any other way of handling this?
http://shopify.com - modern e-commerce software
http://typo.leetsoft.com - Open source weblog engine
http://blog.leetsoft.com - Technical weblog
More information about the memcached