I'm using the JS CacheStorage API, I need to make sure that the cached request is up to date. How can I retrieve the cached time of the saved cache?
Asked
Active
Viewed 783 times
1 Answers
2
In your cache object, you can simply store the Date.now.
Note: I would post it as a comment but I don't have the reputation for that.
Yousuf Khan
- 318
- 2
- 12
-
it's still not clear how to add data to response when It cached – Rivka Aug 14 '19 at 05:23
-
1To add data to a response before caching, you must reconstruct the response as seen in this answer: https://stackoverflow.com/a/35421180/5500690 – electrovir Nov 14 '19 at 19:24