JSONCache is a lightweight library to help with fetching JSON
data in flaky networks (eg. with mobile phones).

It caches the requested data in HTML5 localStorage on the
client side, and further attempts to fetch the same data
(identified by the URL) don't thus need any networking, even
if the browser window is closed.

The library attempts to fetch the data multiple times to avoid
errors with small network interrruptions.

Dependencies

jQuery (tested with 1.6.2, 1.6.3)

JSON.parse and JSON.stringify (available in modern browsers)

window.localStorage (available in modern browsers)

Install

Include the jsoncache-x.y.z.min.js file from the build directory to your site and you're good to go!