Caching large amount of ajax returned objects
Posted
by
ofcapl
on Programmers
See other posts from Programmers
or by ofcapl
Published on 2014-06-12T13:32:32Z
Indexed on
2014/06/12
15:39 UTC
Read the original article
Hit count: 455
I'm building an application which fetches large amount of items with ajax requests via other application API. It returns me 6k - 30k js objects which are used multiple times across various application views (sorting, filtering etc.). I would like to avoid querying API every time for such big list so I decided to cache this data somehow.
I was thinking about various solutions:
- saving it to localstorage,
- using some caching library (e.g. locachejs),
- storing in js var.
I'm not an expert so I would like to hear Your suggestions about each (or one of these) solution, about its pros and cons.
Every help will be very appreciated.
© Programmers or respective owner