Caching large amount of ajax returned objects
- by ofcapl
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.