Back to Community

Resolving Issues When LiteSpeed Cache's Object Cache File Persists After Disabling

13 threads Sep 16, 2025 PluginLitespeed cache

Content

If you've disabled object caching in the LiteSpeed Cache plugin but are still encountering errors related to the object-cache.php file, you're not alone. This is a known behavior that can cause significant issues on a WordPress site. This guide explains why it happens and the steps you can take to resolve it.

Understanding the Problem

When you enable the Object Cache feature (for Redis or Memcached), the LiteSpeed Cache plugin creates a file named object-cache.php in your wp-content/ directory. This file is integral to how WordPress interfaces with the external object cache service.

The core issue, as reported by users, is that disabling the feature in the plugin's settings does not automatically remove this file. Because the file remains, WordPress continues to load it and attempt to connect to the now-disabled Redis or Memcached instance. This results in errors, most notably the failure to retrieve transients, which can break various site functionalities.

Why This Happens

Based on community reports and plugin behavior, the object-cache.php file is treated as a semi-permanent component. The plugin's design does not include an automatic cleanup routine for this file upon feature deactivation. This can be considered a gap between user expectation and the plugin's actual behavior.

How to Fix It: Manually Remove the File

The definitive solution is to manually delete the object-cache.php file. This action will force WordPress to fall back to its default database-based object caching, immediately resolving the connection errors.

  1. Access Your Server: Connect to your website's server using SFTP, FTP, or your hosting provider's file manager.
  2. Navigate to the Root Directory: Locate your WordPress installation's root directory (where wp-config.php is located).
  3. Go to wp-content: Open the wp-content/ folder.
  4. Find and Delete the File: Look for the object-cache.php file. Right-click on it and select Delete or Remove.

Important: You should only perform this deletion after you have disabled the Object Cache feature within the LiteSpeed Cache plugin settings. Deleting the file while the feature is still active could cause undefined behavior.

Best Practices and Considerations

  • Always Backup: Before making any changes to your site's files, ensure you have a recent backup.
  • Plugin Deactivation: As noted in other community threads, the plugin does not perform a full cleanup of all cache files and data upon deactivation. This behavior is consistent for the object-cache.php file. Manual intervention is often required.
  • Re-enabling Object Cache: If you decide to use object caching again in the future, the LiteSpeed Cache plugin will regenerate the object-cache.php file automatically when you enable and save the settings.

By understanding this behavior and knowing how to manually clean up the file, you can prevent errors and ensure your site functions correctly after disabling object caching.

Related Support Threads Support