Why Isn't WP Super Cache Serving Static HTML Files? (And How to Fix It)
Content
If you've configured WP Super Cache but your pages are still being generated dynamically instead of served from a static HTML cache, you're not alone. This is a common point of confusion that can prevent you from getting the full speed benefits of the plugin. This guide will help you understand why this happens and walk you through the steps to resolve it.
Understanding the Problem: PHP vs. Static HTML Files
WP Super Cache operates in two primary modes:
- Simple Mode (PHP Caching): Serves cached content from PHP files (e.g.,
wp-cache-xxxxxx.php). This is faster than an uncached page but still requires PHP processing. - Expert Mode (Static HTML Caching): The most efficient method. Apache's
mod_rewrite(via.htaccessrules) serves pureindex.htmlfiles directly, bypassing PHP entirely for the fastest possible response.
The goal is to have Expert Mode working correctly. If you see comments in your page source like <!-- Dynamic page generated in X.XXX seconds. --> without the text "super cache", it means the page was not served from a static HTML file.
Why Static HTML Caching Might Not Be Working
Based on common community reports, here are the most frequent reasons Expert Mode fails to serve static files:
- Cookies or User Sessions: The presence of any cookie (e.g., from a comment author, a cookie consent banner, or a logged-in user) can prevent the plugin from serving a static file. The
.htaccessrules are designed to skip the cache if a cookie is detected. - Incorrect or Missing
.htaccessRules: If the plugin cannot write the necessary rewrite rules to your.htaccessfile, or if they are corrupted, static file serving will not work. This can happen due to file permission issues. - Query Strings or POST Requests: The default
.htaccessrules exclude any request with a query string (e.g.,?utm_source=example) or that uses the POST method. - Custom Cache Directory: A known bug, as mentioned in the sample threads, is that if you move the cache directory outside of the web root, the
.htaccessrules are not updated to reflect the new path. This causes the plugin to silently fall back to Simple Mode caching. - Server Configuration (Nginx/IIS): Expert Mode relies on Apache's
mod_rewrite. On servers running Nginx or IIS, you must manually configure the server to serve theindex.htmlfiles, as the plugin's automatic.htaccessrules have no effect.
How to Troubleshoot and Fix the Issue
Follow these steps to diagnose and resolve why static files aren't being served.
Step 1: Enable and Check the Debug Log
The debug log is your most powerful tool for figuring out what WP Super Cache is doing.
- Go to WP Super Cache -> Settings -> Debug.
- Enable debugging by checking the box and select "Log to file".
- Visit your website in a new incognito/private browser window (to avoid user cookies).
- Check the debug log (
wp-content/cache/wp-cache-config.phpor via the "Debug Log" tab). Look for lines that explain why a cached file was rejected or not served. Common messages include "URI rejected. Not Caching" or "Skipping non-static active processing".
Step 2: Verify Your .htaccess Rules
Ensure the WP Super Cache block of rules is present and correct in your root .htaccess file. The rules should look similar to the example found in the sample threads. If you see duplicate blocks, you can safely remove the extras. If the rules are missing, try clicking "Update Mod_Rewrite Rules" on the Advanced settings page.
Step 3: Check for Conflict-Causing Cookies
Use your browser's developer tools (Network or Storage tab) to see what cookies are being set on your site. If you see any cookies from plugins (like cookie banners) on pages for anonymous users, they are likely preventing static cache delivery. You may need to configure those plugins not to set cookies for all visitors, or adjust the RewriteCond lines in your .htaccess file to ignore that specific cookie (this requires advanced knowledge).
Step 4: Use the Built-In Cache Tester
On the "Contents" tab, use the "Test Cache" button. This will directly check if the plugin can serve a static file to your browser and will report the result.
Step 5: Consider Your Cache Location
If you have changed the cache directory to a location outside of the web root, be aware of the bug that prevents .htaccess rules from updating. For Expert Mode to work, the cache likely needs to remain in the default wp-content/cache/ location so the rewrite rules can find it.
Conclusion
Getting WP Super Cache to properly serve static HTML files is key to unlocking its full potential. The process almost always involves some investigation using the debug log to see why the cache is being bypassed. By methodically checking for cookies, verifying your .htaccess rules, and using the cache tester, you can identify the hurdle and get your site serving blazing-fast static pages.
Related Support Threads Support
-
Pages cached to PHP files instead of HTML files?https://wordpress.org/support/topic/pages-cached-to-php-files-instead-of-html-files/
-
file permissions of a downloadable PDF is changing on its ownhttps://wordpress.org/support/topic/file-permissions-of-a-downloadable-pdf-is-changing-on-its-own-2/
-
where does Super Cache pull web site stylehttps://wordpress.org/support/topic/where-does-super-cache-pull-web-site-style/
-
Remove alias domain from cachinghttps://wordpress.org/support/topic/remove-alias-domain-from-caching/
-
Bug: .htaccess file created in the wrong folderhttps://wordpress.org/support/topic/bug-htaccess-file-created-in-the-wrong-folder/
-
don’t cache root url (expert mode)https://wordpress.org/support/topic/dont-cache-root-url-expert-mode/
-
Bare directory indexhttps://wordpress.org/support/topic/bare-directory-index/
-
index-https.html ~~It requires a folder with the same namehttps://wordpress.org/support/topic/index-https-html-it-requires-a-folder-with-the-same-name/
-
Issue with cached page URLshttps://wordpress.org/support/topic/issue-with-cached-page-urls/
-
fastfood folder?https://wordpress.org/support/topic/fastfood-folder/
-
/pdf/ corrupt PDFhttps://wordpress.org/support/topic/pdf-corrupt-pdf/
-
A subdomain caching issue named mail.mydomain.comhttps://wordpress.org/support/topic/a-subdomain-caching-issue-named-mail-mydomain-com/
-
Htaccess file questionhttps://wordpress.org/support/topic/htaccess-file-question-2/
-
How to replace string on HTML output?https://wordpress.org/support/topic/how-to-replace-string-on-html-output/
-
Fixing a Hacked Site Questionhttps://wordpress.org/support/topic/fixing-a-hacked-site-question/
-
Help with cache locationhttps://wordpress.org/support/topic/help-with-cache-location/
-
Redirects in expert mode cause SEO issueshttps://wordpress.org/support/topic/redirects-in-expert-mode-cause-seo-issues/
-
Cached style.css not renewed when cache is deletedhttps://wordpress.org/support/topic/cached-style-css-not-renewed-when-cache-is-deleted/
-
PHP in cache-directoryhttps://wordpress.org/support/topic/php-in-cache-directory/
-
Custom Rewrite Rules not being cachedhttps://wordpress.org/support/topic/custom-rewrite-rules-not-being-cached/
-
Distinguishing cached page served by php or by mod rewritehttps://wordpress.org/support/topic/distinguishing-cached-page-served-by-php-or-by-mod-rewrite/
-
Expert mode with cache location outside of web root okay?https://wordpress.org/support/topic/expert-mode-with-cache-location-outside-of-web-root-okay/
-
Probable bughttps://wordpress.org/support/topic/probable-bug-2/
-
Can’t configuring Nginx with WP Super Cachehttps://wordpress.org/support/topic/cant-configuring-nginx-with-wp-super-cache/
-
Weird issue with double-slashes AFTER updating to 1.9.0https://wordpress.org/support/topic/weird-issue-with-double-slashes-after-updating-to-1-9-0/
-
What would cause Super cahce to download my root url as a pose to serve it?https://wordpress.org/support/topic/what-would-cause-super-cahce-to-download-my-root-url-as-a-pose-to-serve-it/
-
Filter to intercept cached static HTML files, right before they are serverd.https://wordpress.org/support/topic/filter-to-intercept-cached-static-html-files-right-before-they-are-serverd/
-
Slow TTFB even with htaccess rules compared to just html filehttps://wordpress.org/support/topic/slow-ttfb-even-with-htaccess-rules-compared-to-just-html-file/
-
Frontpage changes to needs-rebuild after couple of minuteshttps://wordpress.org/support/topic/frontpage-changes-to-needs-rebuild-after-couple-of-minutes/
-
Naked Domain and WWW domain Cached Separately??https://wordpress.org/support/topic/naked-domain-and-www-domain-cached-separately/
-
Problem with frontpage redirectionhttps://wordpress.org/support/topic/problem-with-frontpage-redirection/
-
Static HTML file not being served?https://wordpress.org/support/topic/static-html-file-not-being-served/
-
meta-wp-cache and wp-cache files updateshttps://wordpress.org/support/topic/meta-wp-cache-and-wp-cache-files-updates/
-
Duplicate code in htaccess?https://wordpress.org/support/topic/duplicate-code-in-htaccess-2/
-
HTTPS issue?https://wordpress.org/support/topic/https-issue-30/
-
What are the right folder for .htaccess width supercache directiveshttps://wordpress.org/support/topic/what-are-the-right-folder-for-htaccess-width-supercache-directives/
-
slashes issues (not at the end of url)https://wordpress.org/support/topic/slashes-issues-not-at-the-end-of-url/
-
new template file not being servedhttps://wordpress.org/support/topic/new-template-file-not-being-served/
-
Wp-cache generated instead supercache fileshttps://wordpress.org/support/topic/wp-cache-generated-instead-supercache-files/
-
Different cache versions by cookiehttps://wordpress.org/support/topic/different-cache-versions-by-cookie/
-
Seems non-functional on IIS with URL-re-write and permalinks onhttps://wordpress.org/support/topic/seems-non-functional-on-iis-with-url-re-write-and-permalinks-on/