PBarnsterChar
PBarnsterChar
CDCloudflare Developers
Created by PBarnsterChar on 4/18/2024 in #general-help
Cache rule not creating expected caching behaviour
Hey all, I am having some confusing issues with caching requests that I am routing through a worker. The setup I have is a Cloudflare worker at a custom domain - "something.com" - and a CNAME DNS record in the same zone which points the "origin.something.com" subdomain towards my AWS cluster. The worker handles the request and forwards it to "origin.something.com" by modifying the url of the request. In my caching rules I have cache everything rule set on for requests matching "(http.request.full_uri contains "origin.something.com")", and a separate bypass cache rule for good measure with "(http.host eq "something.com")" Therefore, my understanding would be that requests to something.com, hit cloudflare, bypass the cache, reach the worker, are forwarded to "origin.something.com", then hit the cache or sometimes miss and go to my AWS cluster. However, currently all of my cache hits in the Caching overview show as having "something.com" as their host. Can anyway see what is going wrong here?
2 replies