In WordPress CMS when we see health of the site (located under Tools and then Site Health section), you may notice following error message “Page cache is not detected, but the server response time is OK”.
What is this and how to get rid of it?
This is not error actually, but an indication that the WordPress could not detect any native or WordPress compatible caching plugin solution that could cache the pages in PHP norms, but somehow page response time is fast because there could be some sort of external caching solution which cannot be detected by WordPress itself; or the web hosting server could be in the same country you are living in.
How To Fix This Issue?
If you are not using any caching plugin/solution then we recommend using one, if using already, but some different one like the server-side cache then you can ignore this message all together as there is nothing to worry about as WordPress itself cannot detect any other caching solution running outside PHP norms.
How It Detects the Issue?
Generally, less than 600 milliseconds threshold is imposed by the WordPress CMS to ignore the need of a caching plugin or solution. But for better speed, it suggests using one.
If it takes more than 600 milliseconds, then you must look into the problem and fix it asap.
Page cache enhances the speed and performance of your site by saving and serving static pages and contents instead of calling for a page every time a user visits. Page cache is detected by looking for an active page cache plugin, as well as making three requests to the homepage and looking for one or more of the following HTTP client caching response headers:
- cache-control
- expires
- age
- last-modified
- etag
- x-cache-enabled
- x-cache-disabled
- x-srcache-store-status
- x-srcache-fetch-status
If none of the above detected, it will show the warning!
In my case I too use server side cache of Nginx, and it has X-Cache response header so the message of “Page cache is not detected, but the server response time is OK” appears inside my dashboard too.
You can totally ignore this message. But if you are working for a client who cannot ignore this issue, then add a dummy header in the server’s configuration, which will be fake, but it will remove the message.
Here are headers directive for Nginx:
add_header Cache-Control "no-cache";
add_header x-cache-enabled "true";
Simply, add them to below other headers or in the server block, or even you can place them inside the location block; it is totally on you how you have configured everything.
As I manage multiple domains, I have put it in HTTP block section to apply the same across all the domains.
Leave a Reply