Ticket #379 (closed enhancement: fixed)

Opened 2 months ago

Last modified 2 months ago

CacheManager - expireByKeySnippet(), clearByKeySnippet() two new versatile purging mechanisms

Reported by: lmajano Assigned to: lmajano
Priority: high Milestone: 2.6.0
Component: ColdBox Cache Version:
Severity: normal Keywords:
Cc:

Description

This is thanks to our posts in the forums.

I have an idea for a CacheManage feature. At the moment, you can only clear or expire a single key or everything. I was thinking that you could tell CacheManager to expire or clear a set of keys identified by some wildcard or regexp pattern. I'll give you an example:

I'm using the ColdBox cache manager to cache search results recordsets. For each search, I build a unique hash key from the criteria and prepend it with "SEARCH-". It would be nice to be able to expire all search results by telling CacheManager to expire keys starting with "SEARCH-".

Looking at the code, it seems like a fairly straightforward thing to do. I'm probably going to write my own by accessing the object pool directly but I think this could be a permanent feature of the CacheManager (which is already an awesome tool by the way).

This can be done just like the purgeViews mechanism is done.

Change History

03/30/08 23:08:24 changed by lmajano

  • status changed from new to closed.
  • resolution set to fixed.
  • summary changed from CacheManager - expireKey,clearkey - Add the ability to expire a set of keys via regex or snippets to CacheManager - expireByKeySnippet(), clearByKeySnippet() two new versatile purging mechanisms.

Copyright 2006 ColdBox Framework by Luis Majano