Page Cache Is Not Detected But the Server Response Time Is OK

Published in

on

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 pages in PHP and WordPress known 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 is making the response faster.

So here understood the indication of WordPress health.

Page cache

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.

If you wish to use any caching plugin in WordPress then WP Super Cache is best plugin to begin with,there are more like W3 Total Cache but bit tricky side.

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 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 WordPress 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 instead of Server block section to apply the same across all the domains.

Leave a Reply

Your email address will not be published. Required fields are marked *