←back to thread

Cache

(developer.mozilla.org)
147 points aanthonymax | 1 comments | | HN request time: 0s | source
Show context
judah ◴[] No.45129306[source]
Cache is super useful for making web apps available offline.

I run a guitar chord chart site[0] that uses cache to enable offline experience; any chord charts you view while online are then available offline thanks to cache. It works pretty great. You service worker intercepts HTTP requests and can first check the cache for cached request/responses.

[0]: https://messianicchords.com

replies(1): >>45129943 #
inetknght ◴[] No.45129943[source]
> Cache is super useful for making web apps available offline.

... until you find someone who has very low cache available. Or cache gets evicted.

replies(5): >>45129989 #>>45130694 #>>45131396 #>>45131818 #>>45132139 #
1. judah ◴[] No.45131818[source]
...that's OK.

My app works fine online or offline. If you're offline and you ran out of disk space and the cache got evicted, ok, you can't use my web app offline.

(And, if you're out of disk space, all bets are off. You're gonna have other, more significant problems beyond a guitar chord chart site not working offline.)