开发者

What are the options to cache random data in a browser environment?

开发者 https://www.devze.com 2023-03-24 04:24 出处:网络
If I happen to retrieve a bunch of random data (text in my case), what are all the options for caching it across page loads?

If I happen to retrieve a bunch of random data (text in my case), what are all the options for caching it across page loads?

Currently I can think of:

  • localStorage
  • indexedDb
  • userData

Basically these are the key factors:

  • As much storage as possible
  • Store it for a day at least
  • Can be done programmatically with JavaScript
  • As high cross-browser开发者_如何学Go solution as possible


If you can afford to create this in HTML5 only, supporting only modern browsers, I would advice "Mark Pilgrim's DiveIntoHTML5 chapter on Web Storage". Since this is the only official standard, it has an advantage over custom browser-specific storage options.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号