I have a worker in the wild that has suddenly been receiving an exception “Unable to delete cached response” when I try to do
await cache.delete(request, options) for one particular URL. The code is only called after
await cache.match(request, options) returns a cached Response, so it’s unclear why this particular cached response cannot be deleted. Cloudflare usually returns
false, like the spec, if there is no record to delete after all, so this seems more like a bug?
The same code runs without issue copied into another worker, so presumably the cache has to get into some state to induce. Is this an error I should ever get and if so, how do I resolve it?
If it’s helpful (it probably is!) the response is coming from Shopify, so it’s O2O. Might be related. It’s the /cart.js GET endpoint. It shouldn’t ever be cached, yet cache.match() is actually returning a Response.