Cloudflare Worker Cache API Poor HIT Ratio

Hello,

We have recently deployed a high-volume Cloudflare Worker that does some image processing. The worker utilizes the Cache API, however, the HIT ratio only gets up as high as 70%.

30% of the requests return as DYNAMIC according to the cache dashboard. When we test the paths that are said to be DYNAMIC we receive a cache HIT. Making it difficult to diagnose the problem.

The Worker performs a fetch operation to a secondary server that does some operations, so we want to minimize these secondary requests. The secondary server also sets the cache control.

We have had a tough time figuring out is why 30% of the requests return as DYNAMIC. Before when we weren’t using the Worker cache our HIT ratio was closer to 95%.

Any help would be appreciated!

After the fetch to the provider do you cleanup some headers? and then enforce you own cache headers?

Not within the Worker no. The server which the fetch calls out to sends in the Cache-Control headers and I don’t edit them after that.

Any other thoughts? Still running into this issue.

Thanks