Page rule "Origin Cache Control" not working

The page rule option “Origin Cache Control” is not working. I tested this option with ON and OFF and cloudflare always create a different cache version from each Origin.

Example:

When a request on /js/app.core.js come from the following origins “www.domain.com”, “domain”, “www2.domain”, “www3.domain”, “www4.domain” clouflare will go to my server 4 times instead make a cache of first request and answer all following requests with a cache of file.

Does anyone have the same issue?

Can you post an example link where this happens? “origin cache control” indicates whether or not Cloudflare respects the cache-control response header the server sends back (by default, it does).

1 Like

Just to ensure I understand you correctly, you are making requests for what is in reality the same asset, but using different hostnames? The path and file are are the same.

Cloudflare uses a cache key to determine if two requests are for the same asset. The host name forms part of the key, so in this case the requests don’t match anything in the cache.

You could change the cache key on an Enterprise plan, but your use case seems strange. Why not just use one of the hostnames to be authoritative for the asset?

1 Like

I don’t have an Enterprise plan.

I got success fixing this issue by creating a worker. :slight_smile: