If the data is large, using localStorage is likely to be a bad idea. See http://www.nczonline.net/blog/2012/03/07/in-defense-of-localstorage/
The problem is that localStorage is a synchronous API, so browsers can't provide access to the API until the data is all loaded. Putting lots of data in there will slow down the loading of the whole page.
IndexedDB should work better for this.