Title: Don&#8217;t cache widget
Last modified: February 19, 2020

---

# Don’t cache widget

 *  Resolved [carlosrms](https://wordpress.org/support/users/carlosrms/)
 * (@carlosrms)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/dont-cache-widget/)
 * I’m thinking of switching from wp-fastest cache to wp-optimize. But I missed 
   a very important feature for my website: don’t cache this widget.
    How to do 
   this with your plugin?
 * Or first process the header (for example, if a user has accessed via google then
   opens a specific screen, otherwise, it does not)
    Thanks

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

 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/dont-cache-widget/#post-12460825)
 * Hi there,
 * > How to do this with your plugin?
 * Unfortunately, this isn’t currently possible.
 * Marc.
 *  [tunisi45](https://wordpress.org/support/users/tunisi45/)
 * (@tunisi45)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/dont-cache-widget/#post-12986893)
 * It could be an important feature to add. I’m bypassing this issue by re-saving
   the widget everytime I add a new post. It’s the only way I’ve found to have the
   latest posts updated on the sidebar. Despite this issue WP-Optimize is an awsome
   cache plugin too.
 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/dont-cache-widget/#post-13002466)
 * [@tunisi45](https://wordpress.org/support/users/tunisi45/)
 * Saving the widgets simply purges all the cache, so you could do just that.
 * If you want to do it automatically, you can use the `wpo_purge_all_cache_on_update`
   filter:
 * `add_filter( 'wpo_purge_all_cache_on_update', '__return_true' );`
 * or for something more specific:
 *     ```
       add_filter( 'wpo_purge_all_cache_on_update', function($purge, $post_id) {
       	// Check something about that post (e.g. post_type, category...)
       	if (checksomething($post_id)) {
       		return true;
       	}
       	return $purge;
       }, 20, 2 );
       ```
   

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

The topic ‘Don’t cache widget’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

## Tags

 * [don't cache](https://wordpress.org/support/topic-tag/dont-cache/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 3 replies
 * 3 participants
 * Last reply from: [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/dont-cache-widget/#post-13002466)
 * Status: resolved