Default Access-Control-Allow-Origin for workers

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.

I use x-version and x-inception (time now) headers to better debug, does this help? Or you ar looking for something different.

Thanks, but I need to know why the script is failing. I am suspicious it is a Cache performance overload. If I tweak my code to remove one cache put (which is just an update/overwrite of an existing record) the error ceases to happen.

might not be relate, I use this way:

let response = await cache.match(event.request.url);
    if (!response) {

not just event.request