From the server, I removed any cookies, response headers confirm it.
I tried with https://cf-cache-status.net, strangely the 1st visit shows Error/Miss, subsequent visits show a Hit. However, http response headers still show cf-cache-status EXPIRED
No, I never see a HIT in devtools. It’s always expired. I cleared cache, hard reloaded, tried on both Firefox and Chrome.
However, when I put in your curl command, I did get a HIT. But when I curl with the url without the trailing / like this curl -I https://dcciinfo.ae it gives me EXPIRED
So, is it actually getting a HIT? and why is there a discrepancy with the cf-cache-status?
And also, ttfb from https://gf.dev/ fluctuates by a lot, yesterday New York showed around 0.2, now both New York and Bangalore shows 0.6+. So if it is cached on CF edges, why is the TTFB so high?
By default, Cloudflare respects the origin web server’s cache headers in the following manner unless overridden via an [ **Edge Cache TTL** ](https://support.cloudflare.com/hc/articles/218411427#summary-of-page-rules-settings) Page Rule:
EXPIRED
The resource was found in cache but has since expired and was served from the origin web server.
I have tested using cURL on my end and I was not able to replicate the issue consistently as in the first time I observed a cf-cache-status: EXPIRED but all subsequent requests were cf-cache-status: HIT. Are you able to consistently replicate this on your end? I tested against this URL - https://dcciinfo.ae
Can you change your page rule to this and see if that makes any difference for you.
Yes, the 1st request shows a HIT, the url is with a trailing /. However, in the browser, it gets redirected to the url without the trailing / and it shows EXPIRED
My 3rd request is the same url without ending / and it shows EXPIRED.
Similarly, all other pages on the domain show MISS first, then when I hard reload, it shows EXPIRED
But I set Origin Cache Control: Off in the Page Rule and it worked! After a couple of refreshes, it all shows HIT now, thanks to all of you!
I thought Origin Cache Control would be respected with that setting on, and the max-age and Expiry date are all in the future; and I also thought Edge Cache would override it.
Even then, I had switched off Origin Cache Control earlier, perhaps there was some other setting/rule overriding it earlier.
On further testing, I found something interesting.
Enabled Litespeed Cache on the server
Used keycdn to check TTFB
Most locations show a small TTFB, and cf-cache-status shows a HIT, so it is having a direct impact. E.g. Frankfurt below shows TTFB as a minuscule 24ms (much joy ). Note it does not show Litespeed cache in the headers
No worries glad you managed to get it to work. I will go ahead and resolve this thread but please let us know if you need any further assistance and we’ll be glad to help.