-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change maxCacheCount default? #57
Comments
@stnor Thanks for the feedback! Also #56 points out that we need a selective cache eviction. Like, you could want to only evict certain values from the cache, when you call a cache buster or the global one, while with the |
I was thinking that as a user I would like to register defaults with a static method, so that if I want a certain TTL or maxCacheCount by default, I could decide so for myself, keeping things DRY. |
@stnor Yes, this is what I meant by the global config.
To evolve that I am thinking of introducing all options of the cache config globally, like |
Yes, sounds great! |
Hi,
Thanks for making the effort to provide a caching library. It looks very promising!
Some feedback
I especially like the ability to evict the cache, but as #56 points out its not currently very useful for maxCacheCount. Also, "cacheBusting" is known as cacheEviction, and is a well-known term. Along the same lines, I don't think it makes sense to limit cache size based on the number of combinations of paramaters for a method. Perhaps it would be better to separate the Cache storage config and the cache strategy?
I find the default behaviour a little bit odd compared to other caching libraries I have used eg eh-cache et.c Typically, a single Cacheable decorator will key up all parameters and maintain a cache for each combination, as compared to the default behavior for ngx-cachable of killing the cache when calling with a new parameter. Please consider changing default behavior for Cacheable. I find it counter-intuitive compared to other libraries/standards, and there are already a few issues that has arisen from this, like #26 and #42
Rather than specifying a maxCacheCount of Number.POSITIVE_INFINITY and a TTL on all the cache-decorators, it would be useful to override the defaults globally. Is that possible?
The text was updated successfully, but these errors were encountered: