Clear cache for specific key(s)

I so love the simplicity of the cacheLib-implementation in XP!

I don’t wanna mess with the simplicity, but could I ask your opinion on a teeny weeny addition to the cache clearing mechanism? The ability to invalidate a single key, or even keys that match a certain pattern?

// Clears the cache.
cache.clear();

// Can I have something like this?
cache.clear('myKey');

// Or even more powerful
cache.clear('myKey*');

// Not to mention
cache.clear(/myRegMatchingABunchOfKeys/);
4 Likes

This will be implemented in the coming or next version.

1 Like

The task for this is here: https://github.com/enonic/xp/issues/4968

Hi! This is now implemented in lib-cache which was moved out of XP 6.11. https://github.com/enonic/lib-cache/issues/1

1 Like