I add a page rule Origin Cache-Control
for *. domain.tld/*
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.
Thank you.
sandro
February 12, 2021, 4:59pm
#2
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.
Hello,
https://support.cloudflare.com/hc/en-us/articles/115003206852-Understanding-Origin-Cache-Control
https://support.cloudflare.com/hc/en-us/articles/202775670-Customizing-Cloudflare-s-cache
@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 ::1.2.3.4
Replace the domain / url with one that will trigger the behaviour you have configured for 404s. Replace the 1.2.3.4 IP address with your origin server IP address or hostname.
sandro
February 12, 2021, 5:00pm
#5
sandro
February 12, 2021, 5:02pm
#6
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.
sandro
February 12, 2021, 5:04pm
#8
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.
sandro
February 12, 2021, 5:14pm
#12
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.
sandro
February 12, 2021, 5:25pm
#14
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.
sandro
February 12, 2021, 5:28pm
#16
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
1 Like
I’m so foolish… I’m so sorry that my stupidity wasted lots of time. I fotgot to setup it globally.
sandro
February 12, 2021, 5:34pm
#18
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.
1 Like
system
closed
February 13, 2021, 5:35pm
#19
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.