Question

I have a Web app that contains a large grid of results. I'd like to store these results in the browser's localStorage for quick retrieval.

However, after about ten searches, localStorage will hit its size limit (which is about 5 MB or so, depending on the brand of browser). I'm wondering what possible negative effects could occur at that point . . .

Will the browser discard older stored items as new ones are added (this is what I'm hoping for)? Will it not store new results without me manually removing old ones? Or will the browser throw an exception?

Was it helpful?

Solution

"[...] changes to the data storage area must either be successful, or the data storage area must not be changed at all."

And a QuotaExceededError is thrown, all specified here: http://www.w3.org/TR/webstorage/#the-storage-interface

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top