Skip to content

Commit

Permalink
Minor edit for Feature Request: Option to disable HTML Compression fo…
Browse files Browse the repository at this point in the history
…r Logged-In Users; see wpsharks/comet-cache#650
  • Loading branch information
renzms committed Feb 15, 2016
1 parent 0353c3a commit 1c12f11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/includes/classes/MenuPageOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,8 @@ public function __construct()
echo ' <p><input type="text" name="'.esc_attr(GLOBAL_NS).'[saveOptions][htmlc_cache_expiration_time]" value="'.esc_attr($this->plugin->options['htmlc_cache_expiration_time']).'" /></p>'."\n";
echo ' <p class="info" style="display:block;">'.__('<strong>Tip:</strong> the value that you specify here MUST be compatible with PHP\'s <a href="http://php.net/manual/en/function.strtotime.php" target="_blank" style="text-decoration:none;"><code>strtotime()</code></a> function. Examples: <code>2 hours</code>, <code>7 days</code>, <code>6 months</code>, <code>1 year</code>.', SLUG_TD).'</p>'."\n";
echo ' <p>'.sprintf(__('<strong>Note:</strong> This does NOT impact the overall cache expiration time that you configure with %1$s. It only impacts the sub-routines provided by the HTML Compressor. In fact, this expiration time is mostly irrelevant. The HTML Compressor uses an internal checksum, and it also checks <code>filemtime()</code> before using an existing cache file. The HTML Compressor class also handles the automatic cleanup of your cache directories to keep it from growing too large over time. Therefore, unless you have VERY little disk space there is no reason to set this to a lower value (even if your site changes dynamically quite often). If anything, you might like to increase this value which could help to further reduce server load. You can <a href="https://github.com/websharks/HTML-Compressor" target="_blank">learn more here</a>. We recommend setting this value to at least double that of your overall %1$s expiration time.', SLUG_TD), esc_html(NAME)).'</p>'."\n";
echo ' <h3>'.__('Do NOT use Html Compression for logged in users?', SLUG_TD).'</h3>'."\n";
echo ' <p>'.__('HTML compression allows for cached pages to load a lot faster compared to the initial visit to the page. Logged in users may have a much slower first time visit of loading of a page because of the HTML Compression. Compared to regular visitors or users who are not logged in, those visitors/users may have a faster experience because of the Auto-Cache Engine and the way it can pre-cache. In short, do NOT turn this off unless you know what you\'re doing.', SLUG_TD).'</p>'."\n";
echo ' <h3>'.__('Enable HTML Compression for logged-in users?', SLUG_TD).'</h3>'."\n";
echo ' <p>'.__('HTML compression allows for faster loading of cached pages however this should remain disabled for logged-in users because their user-specific cache has a much shorter Time To Live (TTL). For example, if you\'re logged into the site as a user and you submit a form, that triggers a clearing of the cache for that user (including the HTML Compressor cache). Lots of little actions you take can result in a clearing of the cache. This shorter TTL is not ideal when running the HTML Compressor. The HTML Compressor does a deep analysis of the page content and the associated resources in order to compress things for you intelligently. For logged-in users, it is better to skip that and just cache the HTML source as-is, avoiding that extra overhead. In short, do NOT turn this on unless you know what you\'re doing.', SLUG_TD).'</p>'."\n";
echo ' <p><select name="'.esc_attr(GLOBAL_NS).'[saveOptions][htmlc_when_logged_in]">'."\n";
echo ' <option value="0"'.selected($this->plugin->options['htmlc_when_logged_in'], '0', false).'>'.__('Yes, disable HTML Compression for logged in users.', SLUG_TD).'</option>'."\n";
echo ' <option value="postload"'.selected($this->plugin->options['htmlc_when_logged_in'], 'postload', false).'>'.__('No, enable HTML Compression for logged in users.', SLUG_TD).'</option>'."\n";
Expand Down

0 comments on commit 1c12f11

Please sign in to comment.