ngx-cache icon indicating copy to clipboard operation
ngx-cache copied to clipboard

create custom cache strategy

Open kunalgrover05 opened this issue 7 years ago • 1 comments

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 avatar Nov 12 '18 13:11 kunalgrover05

@kunalgrover05 sorry for the delay, had busy times. feel free to fire a PR and i'll approve.

fulls1z3 avatar Nov 22 '19 00:11 fulls1z3