Title: Programmatically enable/disable dynamic cache
Last modified: February 19, 2019

---

# Programmatically enable/disable dynamic cache

 *  Resolved [ChromaDot](https://wordpress.org/support/users/soojooko/)
 * (@soojooko)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/programmatically-enable-disable-dynamic-cache/)
 * I know the dynamic cache is disabled for WP logged in users. However, my website
   has its own independent user login system for access to custom functionality.
   What I would like is to disable the dynamic cache for anybody logged into my 
   custom system ( not the WP login ). Is there any way to programmatically disable
   the dynamic cache on-the-fly? This way, I could keep the dynamic cache for normal
   visitors, but disable it for users logged in to my system. Is this possible?

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

 *  Plugin Author [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * (@hristo-sg)
 * SiteGround Representative
 * [7 years, 1 month ago](https://wordpress.org/support/topic/programmatically-enable-disable-dynamic-cache/#post-11222144)
 * If it’s a custom system then we shouldn’t cache users in first place. You could
   use the exclude functionality but if it’s a completely different app, then the
   plugin won’t even be loaded there… Can you be more speciffic?
 *  Thread Starter [ChromaDot](https://wordpress.org/support/users/soojooko/)
 * (@soojooko)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/programmatically-enable-disable-dynamic-cache/#post-11226905)
 * How it works is I have a login form on one of my wordpress pages which logs into
   my custom system. When logged in, my own custom admin bar ( not the WP admin 
   bar ) appears at the top of all the wordpress pages to let the user know they
   are logged in. When dynamic cache is turned on, this custom admin bar doesn’t
   appear – which is expected, as the page is being served from the cache. So what
   I would like – in a perfect world – is the ability to dynamically disable the
   cache when somebody is logged into my system. But keep it enabled for normal 
   visitors. Basically, the same way you disable it for WP logged in users. Hope
   this all makes sense?

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

The topic ‘Programmatically enable/disable dynamic cache’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [ChromaDot](https://wordpress.org/support/users/soojooko/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/programmatically-enable-disable-dynamic-cache/#post-11226905)
 * Status: resolved