开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜