Skip to content

Commit

Permalink
v6.2-a7: * **Cache** Dropped "Cache Favicon.ico" option as it will au…
Browse files Browse the repository at this point in the history
…to fallback into 404 cache. (Lauren)
  • Loading branch information
Hai Zheng committed Feb 29, 2024
1 parent 670ae16 commit 52fca24
Show file tree
Hide file tree
Showing 15 changed files with 175 additions and 216 deletions.
2 changes: 0 additions & 2 deletions data/const.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ cache-rest = true

cache-page_login = true

cache-favicon = true

cache-resources = true

cache-browser = false
Expand Down
2 changes: 0 additions & 2 deletions data/const.network_default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ auto_upgrade = false
;; -------------- Cache ----------------- ;;
;; -------------------------------------------------- ;;

cache-favicon = true

cache-resources = true

cache-browser = false
Expand Down
2 changes: 0 additions & 2 deletions data/preset/advanced.data
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

["cache-page_login",true]

["cache-favicon",true]

["cache-resources",true]

["cache-mobile",true]
Expand Down
2 changes: 0 additions & 2 deletions data/preset/aggressive.data
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

["cache-page_login",true]

["cache-favicon",true]

["cache-resources",true]

["cache-mobile",true]
Expand Down
2 changes: 0 additions & 2 deletions data/preset/basic.data
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

["cache-page_login",true]

["cache-favicon",true]

["cache-resources",true]

["cache-mobile",true]
Expand Down
2 changes: 0 additions & 2 deletions data/preset/essentials.data
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

["cache-page_login",true]

["cache-favicon",true]

["cache-resources",true]

["cache-mobile",false]
Expand Down
2 changes: 0 additions & 2 deletions data/preset/extreme.data
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

["cache-page_login",true]

["cache-favicon",true]

["cache-resources",true]

["cache-mobile",true]
Expand Down
4 changes: 2 additions & 2 deletions litespeed-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: LiteSpeed Cache
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
* Description: High-performance page caching and site optimization from LiteSpeed
* Version: 6.2-a6
* Version: 6.2-a7
* Author: LiteSpeed Technologies
* Author URI: https://www.litespeedtech.com
* License: GPLv3
Expand Down Expand Up @@ -34,7 +34,7 @@
return;
}

!defined('LSCWP_V') && define('LSCWP_V', '6.2-a6');
!defined('LSCWP_V') && define('LSCWP_V', '6.2-a7');

!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
!defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
* **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D)
* **Cache** Specified LSCWP in adv-cache compatible file.
* **Cache** Fixed redirection loop if query string has tailing ampersand (#389629)
* **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren)
* **Cloud** Carried on PHP ver for better version detection purpose.
* **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15)

Expand Down
6 changes: 1 addition & 5 deletions src/base.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Base extends Root
const O_CACHE_COMMENTER = 'cache-commenter';
const O_CACHE_REST = 'cache-rest';
const O_CACHE_PAGE_LOGIN = 'cache-page_login';
const O_CACHE_FAVICON = 'cache-favicon';
const O_CACHE_FAVICON = 'cache-favicon'; // Deprecated since v6.2. TODO: Will drop after v6.5
const O_CACHE_RES = 'cache-resources';
const O_CACHE_MOBILE = 'cache-mobile';
const O_CACHE_MOBILE_RULES = 'cache-mobile_rules';
Expand Down Expand Up @@ -283,8 +283,6 @@ class Base extends Root
const ENV_CRAWLER_LOAD_LIMIT = 'CRAWLER_LOAD_LIMIT';
const ENV_CRAWLER_LOAD_LIMIT_ENFORCE = 'CRAWLER_LOAD_LIMIT_ENFORCE';

// const O_FAVICON = 'litespeed-cache-favicon';

const CRWL_COOKIE_NAME = 'name';
const CRWL_COOKIE_VALS = 'vals';

Expand Down Expand Up @@ -344,7 +342,6 @@ class Base extends Root
self::O_CACHE_COMMENTER => false,
self::O_CACHE_REST => false,
self::O_CACHE_PAGE_LOGIN => false,
self::O_CACHE_FAVICON => false,
self::O_CACHE_RES => false,
self::O_CACHE_MOBILE => false,
self::O_CACHE_MOBILE_RULES => array(),
Expand Down Expand Up @@ -559,7 +556,6 @@ class Base extends Root
self::O_AUTO_UPGRADE => false,
self::O_GUEST => false,

self::O_CACHE_FAVICON => false,
self::O_CACHE_RES => false,
self::O_CACHE_BROWSER => false,
self::O_CACHE_MOBILE => false,
Expand Down
11 changes: 0 additions & 11 deletions src/htaccess.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class Htaccess extends Root
const MARKER_NOCACHE_COOKIES = '### marker NOCACHE COOKIES';
const MARKER_NOCACHE_USER_AGENTS = '### marker NOCACHE USER AGENTS';
const MARKER_CACHE_RESOURCE = '### marker CACHE RESOURCE';
const MARKER_FAVICON = '### marker FAVICON';
const MARKER_BROWSER_CACHE = '### marker BROWSER CACHE';
const MARKER_MINIFY = '### marker MINIFY';
const MARKER_CORS = '### marker CORS';
Expand Down Expand Up @@ -577,16 +576,6 @@ private function _generate_rules($cfg)
$new_rules[] = '';
}

// favicon
// frontend and backend
$id = Base::O_CACHE_FAVICON;
if (!empty($cfg[$id])) {
$new_rules[] = $new_rules_backend[] = self::MARKER_FAVICON . self::MARKER_START;
$new_rules[] = $new_rules_backend[] = 'RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]';
$new_rules[] = $new_rules_backend[] = self::MARKER_FAVICON . self::MARKER_END;
$new_rules[] = '';
}

// CORS font rules
$id = Base::O_CDN;
if (!empty($cfg[$id])) {
Expand Down
1 change: 0 additions & 1 deletion src/lang.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public static function title($id)
self::O_CACHE_COMMENTER => __('Cache Commenters', 'litespeed-cache'),
self::O_CACHE_REST => __('Cache REST API', 'litespeed-cache'),
self::O_CACHE_PAGE_LOGIN => __('Cache Login Page', 'litespeed-cache'),
self::O_CACHE_FAVICON => __('Cache favicon.ico', 'litespeed-cache'),
self::O_CACHE_RES => __('Cache PHP Resources', 'litespeed-cache'),
self::O_CACHE_MOBILE => __('Cache Mobile', 'litespeed-cache'),
self::O_CACHE_MOBILE_RULES => __('List of Mobile User Agents', 'litespeed-cache'),
Expand Down
48 changes: 25 additions & 23 deletions tpl/cache/network_settings-cache.tpl.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
<?php

namespace LiteSpeed;
defined( 'WPINC' ) || exit;

defined('WPINC') || exit;
?>

<h3 class="litespeed-title-short">
<?php echo __( 'Cache Control Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/' ); ?>
<?php echo __('Cache Control Settings', 'litespeed-cache'); ?>
<?php Doc::learn_more('https://docs.litespeedtech.com/lscache/lscwp/cache/'); ?>
</h3>

<table class="wp-list-table striped litespeed-table"><tbody>
<tr>
<th><?php echo __( 'Network Enable Cache', 'litespeed-cache' ); ?></th>
<td>
<?php $this->build_switch( Base::O_CACHE ); ?>
<div class="litespeed-desc">
<?php echo __('Enabling LiteSpeed Cache for WordPress here enables the cache for the network.', 'litespeed-cache'); ?><br />
<?php echo __('It is <b>STRONGLY</b> recommend that the compatibility with other plugins on a single/few sites is tested first.', 'litespeed-cache'); ?>
<?php echo __('This is to ensure compatibility prior to enabling the cache for all sites.', 'litespeed-cache'); ?>
</div>
</td>
</tr>

<?php
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_favicon.tpl.php';
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_resources.tpl.php';
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_mobile.tpl.php';
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_dropquery.tpl.php';
?>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th><?php echo __('Network Enable Cache', 'litespeed-cache'); ?></th>
<td>
<?php $this->build_switch(Base::O_CACHE); ?>
<div class="litespeed-desc">
<?php echo __('Enabling LiteSpeed Cache for WordPress here enables the cache for the network.', 'litespeed-cache'); ?><br />
<?php echo __('It is <b>STRONGLY</b> recommend that the compatibility with other plugins on a single/few sites is tested first.', 'litespeed-cache'); ?>
<?php echo __('This is to ensure compatibility prior to enabling the cache for all sites.', 'litespeed-cache'); ?>
</div>
</td>
</tr>

</tbody></table>
<?php
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_resources.tpl.php';
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_mobile.tpl.php';
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_dropquery.tpl.php';
?>

</tbody>
</table>
Loading

0 comments on commit 52fca24

Please sign in to comment.