Back to Community

Troubleshooting Common Speed Optimizer Memcached and File Caching Issues

Content

Users of the 'Speed Optimizer – The All-In-One Performance-Boosting Plugin' sometimes encounter specific errors related to its Memcached and File-Based Caching features. This guide explains the most common problems, their causes, and the steps you can take to resolve or work around them.

1. Memcached Returning False for Empty Values

The Problem: A known issue exists where the Memcached drop-in (object-cache.php) can incorrectly return false for cached values that are logically 'empty', such as the string '0' or an empty array [].

Why It Happens: This is caused by a specific line of code in the drop-in file that checks if a value is empty before storing or retrieving it. This behavior is considered a corner-case bug that does not affect general plugin functionality but can break specific site features that rely on storing these types of values.

The Solution: The development team is aware of this long-standing issue. Users can monitor the plugin's changelog for updates. As a temporary workaround, consider avoiding caching these specific empty values if possible.

2. PHP Deprecation Notice for Dynamic Property

The Problem: On PHP 8.2 and later, a deprecation notice is logged: Creation of dynamic property WP_Object_Cache::$cache_misses is deprecated.

Why It Happens: PHP 8.2 deprecated the dynamic creation of class properties that were not explicitly defined. The plugin's object cache file was creating this property dynamically.

The Solution: This is a known issue scheduled to be fixed in a future plugin update. The notice is non-critical and does not break your site. You can safely wait for the patch, which will be listed in the plugin's changelog.

3. "stat failed for memcached.sock" Error

The Problem: An error such as stat(): stat failed for /home/.tmp/memcached.sock appears in logs or debugging tools.

Why It Happens: This error is silenced and should not appear on a default setup. It occurs because the plugin is preparing to use a Unix socket for Memcached connections, but the socket file does not yet exist on the server.

The Solution: This error can be safely ignored, as Memcached continues to function normally. The plugin's development team is working on backend modifications to the Memcached service, and this error will disappear once the Unix socket is fully implemented.

4. File Cache Ignoring "OFF" Setting

The Problem: Even when the "File cache cleanup interval" is set to "OFF," cached files older than one week are considered stale and are regenerated.

Why It Happens: The plugin's code contains a hardcoded check that invalidates any cache file older than WEEK_IN_SECONDS. The development team has stated that allowing cache to exist "forever" is not an optimal solution, so a default maximum age of one week was intentionally implemented.

The Solution: This is the intended behavior. There is no setting to have a truly permanent file cache. The one-week maximum age is a design decision.

5. Undefined Constant COOKIEHASH in Multisite

The Problem: On WordPress Multisite installations, enabling File-Based Caching can cause a fatal error or warning: Undefined constant 'SiteGround_OptimizerFile_CacherCOOKIEHASH'.

Why It Happens: The error occurs because the COOKIEHASH constant, which is defined by WordPress, is being referenced in the plugin's code before it has been defined, particularly in Multisite environments.

The Solution: The development team is aware of this bug and is working on a fix. A temporary workaround is to disable File-Based Caching until the plugin is updated. Monitor the official changelog for news of a fix.

General Troubleshooting Steps

  • Memcached Connection Issues: If you find an object-cache-crashed.php file in your wp-content directory, it means the plugin could not connect to the Memcached service. Try toggling the Memcached option off and on again in the Speed Optimizer settings. This often re-establishes the connection and recreates the necessary object-cache.php file.
  • Check the Changelog: Many of these issues are known and being worked on. The plugin's changelog is the best resource to track when fixes are released.

Remember, these solutions are based on community reports and official responses. For persistent issues, reviewing the plugin's changelog for updates is recommended.

Related Support Threads Support