Skip to content

Instantly share code, notes, and snippets.

@L3tum
Last active November 2, 2017 09:42
Show Gist options
  • Save L3tum/d3e35e4eb483cd2c7437e9d8d63dd25e to your computer and use it in GitHub Desktop.
Save L3tum/d3e35e4eb483cd2c7437e9d8d63dd25e to your computer and use it in GitHub Desktop.
Service Worker Research

So I thought about Cachestorage a bit.

Would it be faster to store the names of all caches in an array and whenever you try to get something from the cache, first look through this array to see which cache to look in?

So I wrote a little benchmark and surprise, cachestorage is way faster than the array lookup beforehand. Maybe it would be faster to store the exact URLs in the lookup array, but then you would just recreate the cachestorage....

Anyways, here's the benchmark for anyone wanting to look into it: Benchmark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment