ngx-cache
ngx-cache copied to clipboard
create custom cache strategy
I'm submitting a ... (check one with "x")
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report <!-- Please check the repository for a similar issue or PR before submitting -->
[x] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[x] Feature request
[ ] Documentation issue or request
Current behavior TTL settings for caching can be set globally.
Expected/desired behavior Want to explore different caching strategies which can vary either on a per-key basis, or a function which decides the caching strategy. Example of requirements:
- Build an Offline compatible app. When the app is opened, it will try to fetch data from server based on availability of internet. If internet is not available, always show offline data.
- Have ability to mark functions as changing regularly and infrequently and have different TTLs for them.
If you don't see this to be valuable for ngx-cache, I will try to implement a custom provider with ngx-cache's get/set functions and share here.
@kunalgrover05 sorry for the delay, had busy times. feel free to fire a PR and i'll approve.