Title: Bypass cache programatically
Last modified: August 21, 2016

---

# Bypass cache programatically

 *  Resolved [gruvii](https://wordpress.org/support/users/gruvii/)
 * (@gruvii)
 * [13 years ago](https://wordpress.org/support/topic/bypass-cache-programatically/)
 * Is there a way to bypass the W3TotalCache programatically in some cases? I know
   you can disable caching for logged in users and such for W3TotalCache already,
   but it would be nice to have a hook to do so. I have one of the more complex 
   setups using CloudFlare and Amazon AWS on a multi-site setup and for dev purposes
   it would be great to be able to programatically disable the cache or minification,
   etc in certain instances.
 * Example Case:
    [http://www.domain.com](http://www.domain.com) -> cloudflare direct.
   domain.com -> points to your host, but pulls minified, cached content.
 * I would like to do something like
    dev.domain.com and have that subdomain bypass
   the caching/minification/ etc.
 * Right now I achieve this using the option to bypass the cache based on the user
   agent string and using a Chrome extension. But this is not the best way for many
   reasons.
 * [http://wordpress.org/extend/plugins/w3-total-cache/](http://wordpress.org/extend/plugins/w3-total-cache/)

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

 *  Thread Starter [gruvii](https://wordpress.org/support/users/gruvii/)
 * (@gruvii)
 * [13 years ago](https://wordpress.org/support/topic/bypass-cache-programatically/#post-3797593)
 * I wonder if you could use the WP_CACHE constant and do this in the wp-config.
   php or the w3totalcache check for the W3TC_IN_MINIFY constant in advanced-cache.
   php
 *  Thread Starter [gruvii](https://wordpress.org/support/users/gruvii/)
 * (@gruvii)
 * [13 years ago](https://wordpress.org/support/topic/bypass-cache-programatically/#post-3797598)
 * To be more specific I currently set “Rejected user agents:” under page and minify
   cache settings to “dev” then used a chrome extension to set the user agent. I
   just think there should be a better way based on a subdomain or other method.
 *  Plugin Contributor [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [13 years ago](https://wordpress.org/support/topic/bypass-cache-programatically/#post-3797798)
 * [@gruvii](https://wordpress.org/support/users/gruvii/), the plugin’s FAQ has 
   usage on define’s you can add to exempt calls from page caching.

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

The topic ‘Bypass cache programatically’ is closed to new replies.

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

## Tags

 * [bypass](https://wordpress.org/support/topic-tag/bypass/)
 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [w3totalcache](https://wordpress.org/support/topic-tag/w3totalcache/)

 * 3 replies
 * 2 participants
 * Last reply from: [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/bypass-cache-programatically/#post-3797798)
 * Status: resolved