문제

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?

도움이 되었습니까?

해결책

"[...] 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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top