Skip to content

Instantly share code, notes, and snippets.

View L3tum's full-sized avatar
🎯
Focusing

L3tum

🎯
Focusing
View GitHub Profile
@L3tum
L3tum / Caching.md
Last active November 2, 2017 09:42
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