Clear all cacheKeys by hashKey
See original GitHub issueHello. First of thanks for this awesome lib 😃 I wanted to ask if it is somehow possible to clear all cacheKeys with the same hashKey?
I tried to use CacheClear like this:
@CacheClear({
hashKey: (args) => `projectPermissions-${args[0]}`,
})
async clearProjectCache(projectId: string) {
console.log('clearing cache for project', projectId);
}
but it does not clear and I need to also define a cache key like this:
@CacheClear({
cacheKey: (args) => args[0],
hashKey: (args) => `projectPermissions-${args[1]}`,
})
async clearProjectCache(userId: string, projectId: string) {
console.log('clearing cache for project-user', projectId);
}
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Rails.cache.clear certain key names? - Stack Overflow
Right, but I need to delete all keys that contain a certain string in their name. For instance, all keys that have blog/post...
Read more >cachetools — Extensible memoizing collections and ...
This function is similar to hashkey() , but arguments of different types will yield distinct cache keys. For example, typedkey(3) and typedkey(3.0) will...
Read more >Basic CacheManager Features and Architecture
The method ClearRegion can be used to remove all keys within one region for example. The implementation of regions depends on the cache...
Read more >CCache | API Documentation for Yii 1.1
flush : delete all values from cache. Child classes must implement the following methods: getValue · setValue · addValue · deleteValue · getValues...
Read more >CacheEngine - Overview (Resin 4.0.s170329)
All Methods Instance Methods Abstract Methods ... remove. void remove(HashKey key, HashKey cacheKey, MnodeUpdate mnodeUpdate) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey! This should be resolved in version 8.0.0, please let me know if there are any issues!
Please try the latest tag 😬