Title: Testing if Object Caching works
Last modified: August 12, 2017

---

# Testing if Object Caching works

 *  Resolved [michacassola](https://wordpress.org/support/users/michacassola/)
 * (@michacassola)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/testing-if-object-caching-works/)
 * Hi,
 * how do I see if the plugin is working correctly with Redis?
    I have put this 
   in the top of wp-config.php:
 *     ```
       $redis_server = array(
           'host'     => 'unix:/var/run/redis/redis.sock',
           'database' => 0,
       );
   
       define('NONCE_SALT', 'some text'); 
       define('WP_CACHE_KEY_SALT', 'example.com');
       define('WP_REDIS_USE_CACHE_GROUPS', true);
       ```
   
 * But in the command line when running `sudo redis-cli -s /var/run/redis/redis.
   sock monitor` I just get OK but no output of any caching.
 * How do I see if the plugin works?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/testing-if-object-caching-works/#post-9408952)
 * Great question, [@michacassola](https://wordpress.org/support/users/michacassola/).
   I’ll admit: there isn’t actually a simple way to detect whether the persistent
   object cache is working in the web UI.
 * If you have [WP-CLI](http://wp-cli.org/) installed on your machine, you can run
   a sequence of commands to detect if the cache is persistent:
 *     ```
       $ wp cache set foo bar
       Success: Set object 'foo' in group 'default'.
       $ wp cache get foo
       bar
       ```
   
 * If the cache isn’t persistent, you’ll see an error for the second command:
 *     ```
       $ wp cache set foo bar
       Success: Set object 'foo' in group 'default'.
       $ wp cache get foo
       Error: Object with key 'foo' and group 'default' not found.
       ```
   
 *  Thread Starter [michacassola](https://wordpress.org/support/users/michacassola/)
 * (@michacassola)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/testing-if-object-caching-works/#post-9409230)
 * Thank you for your reply!
    I get this:
 *     ```
       $ wp cache set foo bar --path="/home/admin/web/domain.com/public_html"
       PHP Notice:  Constant NONCE_SALT already defined in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(1020) : eval()'d code on line 65
       Success: Set object 'foo' in group 'default'.
       $ wp cache get foo --path="/home/admin/web/domain.com/public_html"
       PHP Notice:  Constant NONCE_SALT already defined in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(1020) : eval()'d code on line 65
       Error: Object with key 'foo' and group 'default' not found.
       ```
   
 * What does this mean, is it working?
 * **And on a more important note: Cloud you please implement a feature to test 
   if the caching is working or not?**
 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/testing-if-object-caching-works/#post-9409262)
 * > What does this mean, is it working?
 * Based on what you’ve shared, it doesn’t look like the persistent object cache
   is working.
 * > Cloud you please implement a feature to test if the caching is working or not?
 * Filed away already as [https://github.com/pantheon-systems/wp-redis/issues/46](https://github.com/pantheon-systems/wp-redis/issues/46)
 *  Thread Starter [michacassola](https://wordpress.org/support/users/michacassola/)
 * (@michacassola)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/testing-if-object-caching-works/#post-9412300)
 * How do I fix the persistent cache from the error above. Do you need more info?
 * Thanks for filing the issue.
 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/testing-if-object-caching-works/#post-9412395)
 * > How do I fix the persistent cache from the error above. Do you need more info?
 * It’s hard to say without having access to the environment to debug.
 * If you’re a Pantheon customer, you’re welcome to open a support ticket and a 
   CSE will be able to sort it out for you. WordPress.org forum support is limited
   to basic Q&A.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Testing if Object Caching works’ is closed to new replies.

 * ![](https://ps.w.org/wp-redis/assets/icon-256x256.png?rev=3417699)
 * [WP Redis](https://wordpress.org/plugins/wp-redis/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-redis/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-redis/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-redis/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-redis/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-redis/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/testing-if-object-caching-works/#post-9412395)
 * Status: resolved