Search code examples
javascriptresponsecache-controlno-cache

Change response cache header for a request


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?


Solution

  • Basically you can use SessionStorage for storing data for a browser session. More on this you can read here.