I'm working on a web app that uses an external api where I don't have any control on the response cache options. The endpoint gives cache-control: private, no-cache, no-store, must-revalidate, where I need to make response storable and cachable during the user's session or for a short known period of time, so the user doesn't have to wait the response from the api every time. Is there any possible solution for my problem?
Asked
Active
Viewed 45 times
0
-
1Save the contents in a variable...? If you need persistent storage, use the [Cache Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Cache). – D. Pardal Oct 03 '20 at 20:25
1 Answers
0
Basically you can use SessionStorage for storing data for a browser session. More on this you can read here.
![](../../users/profiles/7512914.webp)
svyatis.lviv
- 808
- 6
- 12
- 18