Cache
Last updated Oct 12, 2026
Last updated Oct 12, 2026
The Cache API stores responses in the location that served them.
const cache = caches.default;
let res = await cache.match(request);
if (!res) {
res = await fetch(request);
ctx.waitUntil(cache.put(request, res.clone()));
}
return res;cache.put is per location. A purge from the dashboard clears every location; cache.delete clears only the one running your code.
Was this helpful?