Title: Doesnt play well, when using object-cache
Last modified: December 8, 2022

---

# Doesnt play well, when using object-cache

 *  [Jesper V Nielsen](https://wordpress.org/support/users/jesperher/)
 * (@jesperher)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/doesnt-play-well-when-using-object-cache/)
 * Hello.
    The plugin has troubles when a external object-cache is used.
 * WordPress core is pushing more and more for users to use an external object cache.
 * In our case, in order to solve it, we had to create some custom functionality
   in order to clear the caches.
    But the logic might as well be part of the plugin
 *     ```
       class NestedPagesCache {
   
       	public function __construct() {
       		add_action( 'nestedpages_posts_order_updated', [ $this, 'clear_cache_on_nestedpages_posts_order_updated' ], 10, 2 );
       	}
   
       	public function clear_cache_on_nestedpages_posts_order_updated( $posts, $parent ) {
       		$posts_objs = array_map( [ $this, 'get_post' ], $posts );
       		// update_post_caches( $posts_objs, 'page', false, true );
       	}
   
       	public function get_post( $posts_sub_array ) {
       		// return \get_post( $posts_sub_array['id'] );
       		return \clean_post_cache( $posts_sub_array['id'] );
       	}
   
       }
   
       new NestedPagesCache();
       ```
   

The topic ‘Doesnt play well, when using object-cache’ is closed to new replies.

 * ![](https://ps.w.org/wp-nested-pages/assets/icon-128x128.png?rev=1690043)
 * [Nested Pages](https://wordpress.org/plugins/wp-nested-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-nested-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-nested-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-nested-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-nested-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-nested-pages/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Jesper V Nielsen](https://wordpress.org/support/users/jesperher/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/doesnt-play-well-when-using-object-cache/)
 * Status: not resolved