I just started using Cloudflare a couple of days ago - but noticed something very weird. If I enable development mode (no cache), my website is working as expected using Cloudflare for DNS. However, as soon as I remove this mode and activate the cache, a lot (but not all …) of the resources on my website are giving 404 errors.
As soon as I again activate development mode, it’s working again.
I compared the request headers but they are exactly the same .However, the headers of the answer is different.
With cache activated:
HTTP/2.0 404 Not Found
date: Mon, 20 Aug 2018 22:24:25 GMT
content-type: text/html
cf-cache-status: HIT
vary: Accept-Encoding
expires: Tue, 21 Aug 2018 02:24:25 GMT
cache-control: public, max-age=14400
expect-ct: max-age=604800, report-uri=“https://report-uri.Cloudflare.com/cdn-cgi/beacon/expect-ct”
server: Cloudflare
cf-ray: 44d8451e49466944-CDG
content-encoding: br
X-Firefox-Spdy: h2
And without cache:
HTTP/2.0 200 OK
date: Mon, 20 Aug 2018 22:29:17 GMT
content-type: text/css
x-content-type-options: nosniff
last-modified: Sun, 19 Aug 2018 17:05:58 GMT
etag: W/“6aea-573ccce7fad63”
cache-control: max-age=1209600
expires: Mon, 03 Sep 2018 22:29:17 GMT
vary: Accept-Encoding
expect-ct: max-age=604800, report-uri=“https://report-uri.Cloudflare.com/cdn-cgi/beacon/expect-ct”
server: Cloudflare
cf-ray: 44d84c412d8368ae-CDG
content-encoding: br
X-Firefox-Spdy: h2
I couldn’t understand why and couldn’t find any similar topic over the internet. If it helps, the website is developped with Drupal and hosted by 1and1.
Thanks again for answering Xaq. I didn’t set the page rule too - because from what I understand
Weak ETags can be used across all plan levels, and are supported by default. Strong ETags are for Enterprise customers only, require a Page Rule to activate, …
In my case, I am only using week ETags, so there shouldn’t be anything to configure, right? If there is, what exactly needs to be configured, I am a bit puzzled.
Also, what I think would happen if this was the issue is that the missing page will always be reloaded from cache - but here, it shows a 404.
I set-up a rule when I had this issue to disable cache (cache level = bypass) and this allowed me to remove the 404 errors. I tried today to disable that rule and can’t see any 404 anymore (nothing else changed from my perspective)
I will continue monitoring the situation, but it may have been a temporary issue from Cloudflare (?)