If a page keeps showing X-Powered-Cache: MISS, Powered Cache decided not to cache it. Usually there is a good reason, such as a logged-in visitor or a query string, but sometimes a setting or a plugin is the cause. Powered Cache can tell you the exact reason in a response header.
Available in: Powered Cache (free)
Requires: Access to wp-config.php to turn on the miss reason header.
Find the reason #
- Add this line to
wp-config.php, above the line/* That's all, stop editing! */:
define( 'POWERED_CACHE_MISS_REASON', true );
- Open the page in a private browser window, so you are logged out and have no cookies from your site.
- Reload the page once. The first visit after a cache clear is always a miss, because it creates the cached copy.
- Open the developer tools, go to the Network tab, select the page request and look for
X-Powered-Cache-Miss-Reasonin the response headers. - Find the reason in the table below. When you are done, remove the line from
wp-config.php.
To test from the command line, request the page with GET. A HEAD request, such as curl -I, is never cached and always reports Invalid request method:
curl -s -D - -o /dev/null https://example.com/sample-page/
The debug log constant POWERED_CACHE_ENABLE_LOG also turns on this header.
Miss reasons and fixes #
| Miss reason | What it means | What to do |
|---|---|---|
Uncacheable file | The address contains robots.txt or .htaccess. | Nothing. These files are never cached. |
Invalid request method | The request is not a GET request, for example a form submission or a HEAD request. | Nothing for forms. When testing, use a normal browser request or curl without -I. |
Disallowed file extension | The address ends in .php, .xml or .xsl, such as wp-cron.php or a sitemap. | Nothing. These files are not cached on purpose. |
Page Caching is not enabled | Page Cache is off in the saved configuration. | Turn on Page Cache and save. If it is already on, the configuration file is out of date: use Fix configuration. |
Dev mode is enabled | Development Mode is on. | Turn it off in Powered Cache → Tools or with Powered Cache: Disable Dev Mode in the admin bar. |
Passing nopoweredcache with the query | The address contains nopoweredcache. | Remove the parameter. See Bypass cache. |
Rejected user agent | The browser or bot matches Rejected User Agents. | Check the list for a rule that is too broad. |
Mobile request | The visitor uses a phone or tablet, and Mobile Cache is off. | Turn on Mobile Cache, unless your site must build mobile pages fresh. |
Rejected referer: … | The visitor came from an address that matches the rule shown, from Rejected Referrers. | Check the rule named in the header. |
User logged-in | The browser has a WordPress login cookie. | Expected. Test in a private window, or turn on Logged-in User Cache if you want to cache for logged-in users. |
User left a comment | The browser has WordPress comment author cookies. | Expected, so commenters see their own pending comments. Test in a private window. |
User commented | This visitor commented on this page. | Expected. Other visitors still get the cached page. |
Rejected cookie | One of the browser’s cookie names or values matches Rejected Cookies. | Check the list for a short rule that matches more cookies than intended. |
Rejected page | The address matches Never Cache URLs, or a rule added by a plugin, such as a custom login page. | Check Never Cache URLs. Rules must match the whole path, so /shop does not match /shop/item/, but /shop* does. |
Disallowed query parameter exists | The address has a query parameter that is not in Ignored Query Strings or Cache Query Strings. | Add the parameter to Ignored Query Strings if it does not change the page, or to Cache Query Strings if it does. Common tracking parameters such as utm_source, gclid and fbclid are already ignored. |
DONOTCACHEPAGE defined | A plugin or theme asked not to cache this page. WooCommerce does this on cart, checkout and account pages, and many form and membership plugins do it too. | Usually expected. If the page should be cached, check which plugin sets it, for example by deactivating plugins one by one on a staging site. |
Password protected posts are not cached | The post has a password. | Nothing. Password-protected content is never cached. |
404 pages are not cached | The page was not found. | Fix the link or add a redirect. |
Search result page is not cached | The page is a WordPress search result. | Nothing. Search results are never cached. |
Page Cache not enabled for this post | Don’t cache this post is checked in the editor, or a plugin turned the page cache off for this page. | Uncheck the option in the Powered Cache panel of the editor. In 4.1, the option applies to posts and custom post types, but not to Pages. See Exclude a page from the cache. |
Response code is not 200 | The page answered with another status, such as a redirect or a server error. | Check the status code in the Network tab. Only pages with status 200 are cached. |
The cache directory does not exist for storing cached output | Powered Cache could not create wp-content/cache. | Make wp-content writable for PHP, or create wp-content/cache with write permission. Ask your host if unsure. |
The page cache directory does not exist for storing cached output | Powered Cache could not create wp-content/cache/powered-cache. | Make wp-content/cache writable for PHP. |
MISS without a reason, or no header at all #
X-Powered-Cache: MISSwithout a miss reason: this request created the cached copy. Reload the page; the next response should showX-Powered-Cache: PHP. If it never does, the cache files cannot be written. Check thatwp-content/cache/powered-cacheis writable.X-Powered-Cache: Passing to WordPress: the address has or lacks a trailing slash, unlike your permalink structure. WordPress redirects it to the correct address, which is cached.- No
X-Powered-Cacheheader: either the web server sent the cached file directly (look forX-Powered-By: Powered Cache), or the page cache drop-in is not running. In the second case Powered Cache shows the admin notice Page Cache is not working, because: with a Fix configuration button. See Fix configuration. - The header says the page is cached, but you still see old content: a cache at your host or CDN may answer first. See Hosting compatibility.