I add a page rule
Origin Cache-Control for
Then my original server response with
cache-control: public, max-age=3600. Cloud flare response with no cache-control header and
cf-cache-status: DYNAMIC. Even I enable browser cache header as respect origin.
Assuming you are not on an Enterprise plan, you wouldn’t need that page rule as origin cache control is enabled by default.
However that won’t change what Cloudflare caches. For that you will need to change the cache level and the edge cache duration.
What exactly do you want to achieve?
I want to make cloudflare respect my origin cache-control totally. Even it’s html or any other thing.
@hokichaio First thing to do would be to ensure your origin is actually returning no-cache when a 404 is returned. Try cURL like this:
curl -svo /dev/null https://mydomain.com/a-non-existant-url/ --connect-to ::220.127.116.11
Replace the domain / url with one that will trigger the behaviour you have configured for 404s. Replace the 18.104.22.168 IP address with your origin server IP address or hostname.
Plus, cf-cache-status will be irrelevant here.
I think I have some misunderstanding to the docs. In actual I had read the docs you point before I post the question.
No worries, so everything is working then?
My origin response with
Cache-Control: public, max-age=3600 But cloudflare responses without any cache-control header.
That really does not seem to include a cache-control header.
Would you be comfortable sharing your server IP address here?
Also, post a screenshot of your page rules.
Maybe post the curl output is enough? Thank you.
< HTTP/1.1 200 OK
< Server: nginx/1.14.0 (Ubuntu)
< Date: Fri, 12 Feb 2021 17:18:38 GMT
< Content-Type: text/html
< Content-Length: 641
< Last-Modified: Wed, 13 Jan 2021 03:21:34 GMT
< Connection: keep-alive
< ETag: "5ffe673e-281"
< Cache-Control: public, max-age=3600
< Accept-Ranges: bytes
Only one page rule. The origin cache control I post before.
You shouldn’t need that page rule in the first place.
Without the server address it is impossible to say more and you’d need to open a support ticket.
You have configured that on your HTTP connector, not your HTTPS one.
Furthermore you have an invalid SSL certificate and hence still an insecure connection.
What you need to do is
Configure a proper certificate which is valid
Change your encryption mode to Full strict
Configure that cache-control setting for your HTTPS connector as well
I’m so foolish… I’m so sorry that my stupidity wasted lots of time. I fotgot to setup it globally.
No worries, glad we worked it out. Just make sure you configure a valid certificate as you have an insecure setup right now.
Plus, you can remove the posting with the IP address now if you wish.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.