Created
October 14, 2014 15:37
-
-
Save mannieschumpert/3f30e5ffa068a0525915 to your computer and use it in GitHub Desktop.
W3 Total Cache's approach to conditional loading is rather elegant.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Skip caching for some pages | |
*/ | |
switch (true) { | |
case defined('DONOTCACHEPAGE'): | |
case defined('DOING_AJAX'): | |
case defined('DOING_CRON'): | |
case defined('APP_REQUEST'): | |
case defined('XMLRPC_REQUEST'): | |
case defined('WP_ADMIN'): | |
case (defined('SHORTINIT') && SHORTINIT): | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment