How to tell if URL is cached? cache.match doesn't work

I don’t need to get the cached object, I just want to be able to know if a page is cached or not without hitting the origin server. cache.match(request) returns an error:

The Service Workers Cache API is currently unimplemented in the Cloudflare Workers Preview. Cache API operations which would function normally in production will not throw any errors, but will have no effect. Notably, Cache.match() will always return undefined, and Cache.delete() will always return false. When you deploy your script to production, its caching behavior will function as expected.

Check the Response Headers in the console. If the content is from the cache you should find the header cf-cache-status with the value HIT.

You could also do this to debug cache in production:

let response = await cache.match(cacheKey);

	//your code
	return new Response('from cache')