What happens when LocalStorage hits the maximum storage limit for a domain?
- hit a hard limit and silently stop accepting new values
- hit a hard limit and throw an error
- hit a soft limit and the browser uses a pruning strategy to make room for new values
There is a similar StackOverflow question: What is the max size of localStorage values? which answers the question of what the browser's storage limit is, but that question does not ask or answer what exactly happens when the limit is reached. What the limit is doesn't matter too much to me, what is important to me is what exactly happens when the limit is hit, and if I need to take care of pruning the cache in my client code, or if the browser will do it for me automatically.