Would be great to have a TTL
See original GitHub issueThat way cache entries will automatically expire and not explode memory usage. This is especially important on the server.
This would likely involve you keeping a separate “shadow cache” that kept the created times of the cacheKeys.
Obviously this would be fractionally slower so a simple opt-in (by say {TTL: [any non-zero value in ms]}
in the options) to this code path is probably all you need.
If you’re interested I can submit a PR 😉
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:5
Top Results From Across the Web
What Is TTL (And How Do You Choose the Right One)? - Kinsta
Hopefully, by now you will have a good idea of what TTL value you want for your site. Now we can see how...
Read more >What is a good TTL for DNS? - NsLookup
The ability to survive a short outage caused by Internet DDoS attack, network issue, or DNS provider outage means that the service will...
Read more >What is DNS TTL + Best Practices - Varonis
DNS TTLs are vital to websites that make constant changes and updates frequently. By having a lower TTL, you can ensure that you...
Read more >TTL vs Manual Flash in the Studio - YouTube
TTL vs Manual Flash in the Studio: Take and Make Great ... Gavin finds the results are a real eye opener but will...
Read more >TTL Vs. Manual Flash: Why Is One Always Better Than the ...
Someone will ask if they should use manual or TTL flash when they ... This is great when starting out with flash because...
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
You can just do this in your own cache handler, no need to extend fast-memoize for this.
@leefsmp