Page caching seems not working for both dynamic and static pages

I’ve signed up for Cloudflare, and copied over the API key and my email address, but when I “test cache” I get this error:

Page caching seems not working for both dynamic and static pages.


Error on dynamic page (https://advancedinstitute.ai): Seem that your website is not behind Cloudflare. If you have recently enabled the cache or it is your first test, wait about 30 seconds and try again because the changes take a few seconds for Cloudflare to propagate them on the web. If the error persists, request support for a detailed check.

Error on static resource (https://advancedinstitute.ai/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html): Seem that your website is not behind Cloudflare. If you have recently enabled the cache or it is your first test, wait about 30 seconds and try again because the changes take a few seconds for Cloudflare to propagate them on the web. If the error persists, request support for a detailed check.

Please check if the page caching is working by yourself by surfing the website in incognito mode 'cause sometimes Cloudflare bypass the cache for cURL requests. Reload a page two or three times. If you see the response header **cf-cache-status: HIT** , the page caching is working well.

To avoid a “fake negative” from ** WP Cloudflare Super Page Cache**, I tried to check the headers from chrome inspection panel:

Response Headers:
HTTP/1.1 200 OK
Date: Mon, 20 Dec 2021 01:59:11 GMT
Server: Apache/2.4.29 (Ubuntu)
X-Frame-Options: SAMEORIGIN
Link: <https://advancedinstitute.ai/wp-json/>; rel="https://api.w.org/"
Link: <https://advancedinstitute.ai/wp-json/wp/v2/pages/1770>; rel="alternate"; type="application/json"
Link: <https://advancedinstitute.ai/>; rel=shortlink
Cache-Control: s-maxage=31536000, max-age=60
X-WP-CF-Super-Cache: cache
X-WP-CF-Super-Cache-Active: 1
X-WP-CF-Super-Cache-Cache-Control: s-maxage=31536000, max-age=60
X-WP-CF-Super-Cache-Cookies-Bypass: swfpc-feature-not-enabled
Vary: Accept-Encoding
Content-Encoding: gzip
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Length: 40034
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

I also tried to activate “Overwrite the cache-control header for Wordpress’s pages using web server rules” and the cache still not working =/

Could someone help me solve this problem?

Those headers indicate a direct connection to your Apache server. That’s not what I see. Are you using a local Hosts file on your device?

2 Likes

Thanks for the quick answer ^^
Are you referring to the /etc/hosts file? If yes, I’m using it.

$ cat /etc/hosts

127.0.0.1 localhost

200.145.46.182 advancedinstitute.ai

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Yep. That’s why you’re not seeing any caching in your dev tools.

wow! Really? I’m a little bit “newbie” when the topic is related about infrastructure/network configuration.
If possible, could you send me a “cook recipe” to solve/mitigate this problem? thank you very much

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.