I have a browser app that is accessing a worker. The worker is build so that it can save data to either KV, Cache, or local memory (while it is running). The data store keys are always valid URLs. It works fine under high load for KV and memory. When using the Cache is occasionally throws exceptions on random keys. I say random because we are running the same test set repeatedly and the failure is not always on the same URLs. We have a top level catch on the response handler that sets Access-Control-Allow-Origin to *. It does not appear the catch is activated and a response is sent to the client without an Access-Control-Allow-Origin headers. This makes the error message unavailable due to CORS.
The error does not appear to be a resource limit error based on the worker metrics.
Is there a way to set a default header for Workers? Given that Cache is not implemented in the preview mode, this is VERY hard to debug.