简体   繁体   中英

Caching a big HTTP response?

Once authenticated I save a token which is then used to make further requests but then after page refresh the same request for that token has to be sent.

The JSON response is 9MB. I attemped saving it in localStorage but it exceeds the quota. Is there any way to do this on the client?

Thanks.

There are multiple ways to handle it:

  1. The quota of the local storage can be modified by the user, you can prompt the user to increase the storage.
  2. You can compress the data and reduce its size.
  3. In chrome if you package it to a chrome app then it allows you to change it.
  4. You can use third party library to store such as Dexie.js .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM