Page Rule : Cache Everything - Very High TTFB


It’s first time I’m using / setting up CF so I am not sure if I am being impatient.

I have a pretty long TTFB (3 to 5 seconds) (server-side code, db queries) because of that I have created a cache everything page rule. Am I wrong to think that if there is a cached version of the requested page CF will serve it from it’s own server thus reducing TTFB?

It’s been a while and I see “100 served by CF out of 9.4k request” in the Caching tab. Am I missing a configuration?


It would seem to me that your site is setting cookies that are preventing your resources from being cached. Maybe another @MVP can confirm this.

Thank you for you input @sdayman. I am not setting any cookies explicitly. Can it be Google Analytics / Ads etc. cookies? Is there a way to prevent that?

I see over 20k requests and <200 HITs in the Caching Tab.

Ok, it’s not Google Analytics cookies that’s the problem. I just checked another site with GA and the same cookies aren’t preventing caching. But what I do see is that your Cache-Control: header has a Max Age, but isn’t set to Public.

Got a screenshot of your page rule setup?

1 Like

@sdayman I was having a problem with that and my host wasn’t helping me with the configuration, said that it’s my responsibility and they do not offer such service. But I thought I managed to fixed that, please take a look at the SS.
Here is the SS of the page rule:

All your URLs begin with ‘www’. Your Page Rule does not.


I thought if I wrote that way, it would work both for www and non-www.
I changed it and will let you know if it’s working. Thanks a lot for your help.

@sdayman I am not sure if it’s “working”. Cache got hit a few times as soon as I changed the rule but then got quiet again.

Also I still see IIS in the response headers not Cloudflare:

I have set origin cache control to off in the page rule and now I see " cf-cache-status:HIT" in the response headers.

My website is responsive and doesn’t serve different pages for mobile & desktop. So If I visit a page on my desktop, shouldn’t it be served from cache when I visit the same page on my mobile phone? It’s not the case at the moment.

I’ve been noticing the IIS server in your headers, so you’re doing something to bypass Cloudflare. Perhaps a local hosts file on your computer.

However, for me, I’m finally seeing HITs for your resources, like logo.png

And this is the page content itself:

This topic was automatically closed after 30 days. New replies are no longer allowed.