Background
WP Rocket is one of the most popular caching plugins for WordPress. However, users frequently report: “I installed WP Rocket, but my pages are still slow.” In most cases, the issue isn’t with WP Rocket itself—it’s due to misconfigurations or interference from third-party plugins that prevent cache hits.
Below are the five most common causes encountered in real-world operations.
1. WooCommerce geolocation_ajax Forces 307 Redirects
Symptom: High TTFB (Time to First Byte) on product pages, while the homepage loads normally.
WooCommerce’s geolocation_ajax mode triggers a 307 redirect on every request and appends a ?v= parameter to the URL—causing users to never hit the cache directly.
Diagnosis:
curl -sS -D - -o /dev/null "https://your-domain.com/product/slug" 2>&1 | grep -iE "HTTP/|location"
If you see an HTTP 307 status and the ?v= parameter, this is the culprit.
Fix: For digital storefronts, switch directly to base_address:
wp option update woocommerce_default_customer_address base_address
2. Login-State Cookies Bypass Caching
Symptom: Admins or logged-in users never receive cached versions of frontend pages.
By default, WP Rocket excludes pages served to logged-in users from caching. If your site has many registered users (e.g., membership sites), this means the majority of traffic bypasses the cache entirely.
Diagnosis:
# Access with cookie
curl -sS -D - -o /dev/null -b "wordpress_logged_in_xxx=value" "https://your-domain.com/" 2>&1 | grep -i "x-wp-rocket"
# Access without cookie
curl -sS -D - -o /dev/null "https://your-domain.com/" 2>&1 | grep -i "x-wp-rocket"
Fix: If frontend content is identical for all users, enable “Cache for logged-in users” in WP Rocket’s settings.
3. Query Strings Cause Cache Fragmentation
Symptom: Multiple distinct cache files are generated for the same page due to varying URL parameters.
Tracking parameters—such as UTM tags (?utm_source=...), Facebook’s fbclid, or Google’s gclid—cause WP Rocket to generate separate cache entries for each unique URL.
Diagnosis:
# Count total HTML cache files
find /wp-content/cache/wp-rocket/ -name "*.html" | wc -l
# Check for numerous parameterized cache files
ls /wp-content/cache/wp-rocket/your-domain.com/
Fix: In WP Rocket’s Advanced Settings, add common tracking parameters to the “Query strings to ignore when caching” list:
fbclid
gclid
utm_source
utm_medium
utm_campaign
utm_content
utm_term
4. Other Plugins Define the DONOTCACHEPAGE Constant
Symptom: Certain pages are consistently excluded from caching, with no obvious explanation.
Some plugins define the DONOTCACHEPAGE constant under specific conditions to instruct caching plugins to skip those pages. Common offenders include security plugins, A/B testing tools, and certain form plugins.
Diagnosis:
grep -rn "DONOTCACHEPAGE" /path/to/wp-content/plugins/
Fix: Identify which plugin sets this constant and evaluate whether disabling caching is truly necessary. Often, it’s an overly conservative default behavior.
5. Missing Server-Side Rewrite Rules
Symptom: WP Rocket generates static HTML cache files, yet Nginx/Apache still routes requests through PHP instead of serving the cached files directly.
WP Rocket generates static HTML files—but web servers require explicit rewrite rules to serve them directly and bypass PHP processing.
Diagnosis:
curl -sS -D - -o /dev/null "https://your-domain.com/" 2>&1 | grep -iE "x-wp-rocket|x-powered-by|server"
If the response includes X-Powered-By: PHP but lacks WP Rocket’s cache headers (e.g., X-WP-Rocket: HIT), the static files aren’t being served.
Fix: Ensure your Nginx configuration includes WP Rocket’s official rewrite rules (available in WP Rocket’s documentation), or verify that Apache’s .htaccess contains the corresponding directives.
General Troubleshooting Workflow
# 1. Confirm whether cache is being hit
curl -sS -D - -o /dev/null "https://your-domain.com/" 2>&1 | grep -iE "x-wp-rocket|cache"
# 2. Inspect redirect chain
curl -sS -o /dev/null -w "HTTP: %{http_code} | TTFB: %{time_starttransfer}s\n" -L "https://your-domain.com/"
# 3. Verify cache file existence
ls -la /wp-content/cache/wp-rocket/your-domain.com/
# 4. Clear cache and retest
wp rocket clean --confirm
Run this workflow whenever facing caching issues—it will identify the root cause in most cases.