Skip to content

Commit

Permalink
Adding abiltiy to check option before running the HTML Compressor whe…
Browse files Browse the repository at this point in the history
…n users are logged in; see: wpsharks/comet-cache#650
  • Loading branch information
renzms committed Feb 25, 2016
1 parent fd0170c commit d091710
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/includes/closures/Ac/HtmlCUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
if (!COMET_CACHE_HTMLC_ENABLE) {
return $cache; // Nothing to do here.
}
if ($self->is_user_logged_in && !COMET_CACHE_HTMLC_WHEN_LOGGED_IN) {
return $cache; // Nothing to do here.
}
// Deals with multisite base & sub-directory installs.
// e.g. `htmlc/cache/public/www-example-com` (standard WP installation).
// e.g. `htmlc/cache/public/[[/base]/child1]/www-example-com` (multisite network).
Expand Down
12 changes: 12 additions & 0 deletions src/includes/templates/advanced-cache.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,18 @@ if (!defined('COMET_CACHE_HTMLC_ENABLE')) {
}
/*[/pro]*/
/*[pro strip-from="lite"]*/
if (!defined('COMET_CACHE_HTMLC_WHEN_LOGGED_IN')) {
/**
* Enable HTML compressor when logged in?
*
* @since 140422 First documented version.
*
* @var string|integer|boolean A boolean-ish value; e.g. `1` or `0`.
*/
define('COMET_CACHE_HTMLC_WHEN_LOGGED_IN', '%%COMET_CACHE_HTMLC_WHEN_LOGGED_IN%%');
}
/*[/pro]*/
/*[pro strip-from="lite"]*/
if (!defined('COMET_CACHE_HTMLC_CSS_EXCLUSIONS')) {
/**
* CSS exclusions for the HTML compressor.
Expand Down

0 comments on commit d091710

Please sign in to comment.