adam-lynch / back-of-your-hand

How well do you know your area? Test your knowledge by locating streets with this game.
https://backofyourhand.com
Mozilla Public License 2.0
79 stars 9 forks source link

Aggressive cache storage size (multiple GB/min) #58

Open PatMyron opened 10 months ago

PatMyron commented 10 months ago

From chrome://settings/content/all, this stores more data in ~10min than a decade of heavy web browsing combined

For context, popular browsers surprisingly now default to allowing individual origins to use most of a device's storage: https://stackoverflow.com/questions/10988569/storage-limits-on-chrome-browser

Hopefully there are ideas to mitigate this without rearchitecting an old project too much:

1) Compress cache 2) Limit max cache size 3) Purge old cached data based on rounds or time or site/browser closing 4) Warn users 5) etc.

adam-lynch commented 10 months ago

Thanks @PatMyron. I'll need to dig into it.

This might sound rude, I am not trying to be, but does this cause any "real" issue or is it just that you noticed it?

From a quick look, it looks like it's images. That means it depends on how many different "areas" you've played with. This could be service-worker related too.

PatMyron commented 10 months ago

Still surprised by platform defaults, but it used almost a fifth of my Macbook storage for years before realizing

Not sure if it'd eventually purged that cache if I'd run out of storage space? I try to precede that, and Chrome's cache isn't visible from Mac's storage management app

adam-lynch commented 10 months ago

See https://web.dev/articles/storage-for-the-web#eviction