"Unable to delete cached response" error

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.

That’s weird, could you join the Discord so we can look at this a bit easier and if needed flag it for the team? The invite is: Cloudflare Workers

The exception isn’t documented so I’m not too sure why it would happen. Seems like some internal blocker is stopping it from being deleted. Should definitely dig into what that is and document it