Back to Community

Why Your Speed Optimizer Dynamic Cache Isn't Working (And How to Fix It)

Content

If you're using the Speed Optimizer plugin and finding that your dynamic caching isn't working as expected, you're not alone. A common issue reported by users is the "The URL is not cached" message when using the plugin's Test URLs for Cache Status tool. This article explains why this happens and provides the most common solutions based on community reports.

Why Dynamic Caching Fails: The Core Issue

The primary reason dynamic caching fails to work is the presence of set-cookie headers or PHP sessions on your site. When the Speed Optimizer plugin detects these elements, it intentionally bypasses caching for security reasons. This is a protective measure to prevent sensitive, user-specific information (like shopping cart contents or personal data) from being served to the wrong visitor.

Common indicators of this issue include:

  • The "Test URLs for Cache Status" tool consistently returns "The URL is not cached"
  • Headers like set-cookie, Cache-Control: private, or PHPSESSID appearing in server responses
  • X-Proxy-Cache: MISS headers instead of HIT when checking with curl commands

How to Identify the Source of the Problem

Before attempting fixes, you should confirm that caching is actually not working. Sometimes the testing tool itself might show false negatives, especially if you're logged into your WordPress admin or using Cloudflare (more on this later).

Method 1: Use curl to verify cache status
Open your terminal or command prompt and run:
curl -I -X GET https://yourwebsite.com | grep x-proxy-cache
Look for X-Proxy-Cache: HIT in the response, which indicates successful caching.

Method 2: Check for cookies and sessions
Run: curl -I -X GET https://yourwebsite.com
Examine the output for any set-cookie headers or PHPSESSID references, which indicate something is preventing caching.

Common Causes and Solutions

1. Plugin Conflicts

The most frequent cause of dynamic cache failure is conflicting plugins that initiate PHP sessions or set cookies. Based on community reports, these plugins have been known to cause issues:

  • WooCommerce-related plugins (e.g., Notification for WooCommerce)
  • Booking plugins (e.g., Bookme Pro)
  • Anti-spam/security plugins
  • Social sharing plugins (e.g., SocialSnap)
  • eCommerce plugins (e.g., Easy Digital Downloads)
  • Membership/learning plugins (e.g., LearnDash)

Solution: Perform a conflict test by temporarily deactivating all plugins except Speed Optimizer. If caching works, reactivate plugins one by one, testing after each activation to identify the culprit. Once identified, check the problematic plugin's settings for options to disable sessions or cookies, or consider alternative plugins.

2. Cloudflare Integration

If you're using Cloudflare alongside Speed Optimizer, you might see "URL is not cached" messages even when your site is actually being cached by Cloudflare instead of the Speed Optimizer's dynamic cache.

Solution: This is often expected behavior. Check your cache status using the curl method mentioned above. If you see X-Proxy-Cache: HIT, your content is being cached properly despite what the plugin's test tool shows. The Speed Optimizer team has indicated they're working on improving the test tool's accuracy for Cloudflare users.

3. PHP Sessions

Some plugins or custom code might initiate PHP sessions on every page visit, which prevents caching even for anonymous users.

Solution: Identify and modify the code or plugin settings that create unnecessary sessions. For plugins like Bookme Pro, there are often specific settings that control session creation which can be disabled.

4. Hosting Environment

The Speed Optimizer plugin is primarily designed for SiteGround hosting environments. Some features, particularly dynamic caching, may not work correctly or may be enabled by default on non-SiteGround hosting, which can cause confusion.

Solution: If you're not using SiteGround hosting, check your dynamic caching settings and disable them if they're not functioning properly. The Speed Optimizer team has acknowledged this issue and may address it in future updates.

When Caching Is Actually Working (Despite Error Messages)

In some cases, the test tool might show false negatives. Your caching might be working correctly if:

  • You're testing while logged into your WordPress admin (the plugin doesn't cache pages for logged-in users)
  • You're using Cloudflare (which takes over caching)
  • There's a temporary issue with the test tool itself

Always verify with curl commands or by checking headers directly rather than relying solely on the plugin's test tool.

Conclusion

Dynamic caching issues with the Speed Optimizer plugin typically stem from conflicts with other plugins that set cookies or initiate PHP sessions. The most effective approach is methodical testing: disable plugins one by one, check for session/cookie creation, and verify actual cache status using curl commands rather than relying solely on the plugin's test tool. Remember that if you're using Cloudflare, the "URL is not cached" message might be expected behavior rather than indicating an actual problem with your caching setup.

Related Support Threads Support