Title: [Plugin: WP Super Cache] Basic Developer instructions: conditional cache rebuild
Last modified: August 20, 2016

---

# [Plugin: WP Super Cache] Basic Developer instructions: conditional cache rebuild

 *  [GoodNewsDesign](https://wordpress.org/support/users/goodnewsdesign/)
 * (@goodnewsdesign)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-basic-developer-instructions-conditional-cache-rebuild/)
 * Doncha, I need a bit of help please. Can you outline a strategy for not serving
   a cached file if I have switched themes? I have a plugin that I have written 
   conditionals: if there is a GET variable for the theme switch, I set a cookie
   header location and then if the cookie is set, I add filter for style sheet and
   template. Vice versa for switch-back if the filter exists, remove, etc.
    However
   Super Cache breaks it. I am assuming that a plugin for SC would be the way to
   go? Also, can I do this without falling back to late init? Appreciate the advice
   VERY much 🙂
 * [http://wordpress.org/extend/plugins/wp-super-cache/](http://wordpress.org/extend/plugins/wp-super-cache/)

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

 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-basic-developer-instructions-conditional-cache-rebuild/#post-2311321)
 * Yeah, a plugin for SC is probably the best way. It’ll have to check for that 
   cookie and change the $cache_key.
 *  Thread Starter [GoodNewsDesign](https://wordpress.org/support/users/goodnewsdesign/)
 * (@goodnewsdesign)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-basic-developer-instructions-conditional-cache-rebuild/#post-2311322)
 * Hey, Doncha, quick update: I found that first of all SC is a formidable bit of
   code 😉 and that if you supply it with a fresh get variable, that that solved
   my little problem. If you want a copy of my plugin, let me know. Does seem like
   a timely issue maybe as there seemed to be no real working theme switcher that
   would work with SC!
    So anyway, I ended up tossing the plugin I was writing for
   SC and just making sure the one I already wrote worked… (with SC).
 *  [transparencia](https://wordpress.org/support/users/transparencia/)
 * (@transparencia)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-basic-developer-instructions-conditional-cache-rebuild/#post-2311344)
 * GoodNewsDesign, does your plugin rebuilds the website’s complete cache when the
   theme is changed?
 * That’s exactly what I wanted to do!
 * Can you show me your code, please?
 *  [transparencia](https://wordpress.org/support/users/transparencia/)
 * (@transparencia)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-basic-developer-instructions-conditional-cache-rebuild/#post-2311345)
 * I figured it out. It is actually quite use, just using wp_cache_clear_cache()
   whenever the theme updates options.
 * But I have a question though, in WPMU (Multisite), wp_cache_clear_cache() affects
   only a given website, not the entire network, right?

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

The topic ‘[Plugin: WP Super Cache] Basic Developer instructions: conditional cache
rebuild’ is closed to new replies.

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

 * 4 replies
 * 3 participants
 * Last reply from: [transparencia](https://wordpress.org/support/users/transparencia/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-basic-developer-instructions-conditional-cache-rebuild/#post-2311345)
 * Status: not resolved