I use OpenLayers to cache map fragments. It uses LocalStorage as a mechanism for storing cached tiles. There is an event that fires when I run out of space (i.e. 5 MB), and I have the opportunity to completely clear or repeat the cache.
I use LocalStorage to store other objects, such as settings, so its not very good if I run out of free space.
How to set maximum limit for caches cached by OpenLayers? Preferably as a size limit (not the number of elements).
source share