BoldGrid / w3-total-cache

GNU General Public License v2.0
151 stars 81 forks source link

Browser Cache lifetime causes all cache to be expired if set too high #870

Closed jacobd91 closed 2 months ago

jacobd91 commented 2 months ago

The Browser Cache lifetime (browsercache.html.lifetime) setting can cause all cache entries to be flagged as expired if set above the W3TC_CACHE_FILE_EXPIRE_MAX constant

This PR addresses that by setting the expired value to W3TC_CACHE_FILE_EXPIRE_MAX instead of 0, thereby forcing the max rather than flagging as expired

This PR also makes the Page Cache lifetime (pgcache.lifetime) setting visible when using the Page Cache "Disk Enhanced" engine as the value is used to determine the lifetime of cache files. Previously it was hidden if the engine was set to "Disk Enhanced" but if a value was stored in the config it would apply

Lastly, this PR adds information to various settings concerning the W3TC_CACHE_FILE_EXPIRE_MAX constant indicating that there is a hidden max value that can be overridden via wp-config. These settings include Page Cache Lifetime, Browser Cache HTML/XML lifetime, and Minify Garbage Collection Interval

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 45 lines in your changes are missing coverage. Please review.

Project coverage is 4.22%. Comparing base (5d82cc3) to head (81ed0b9).

Files Patch % Lines
inc/options/pgcache.php 0.00% 18 Missing :warning:
inc/options/browsercache.php 0.00% 13 Missing :warning:
inc/options/minify.php 0.00% 11 Missing :warning:
Cache_File_Cleaner_Generic.php 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #870 +/- ## =========================================== - Coverage 4.22% 4.22% -0.01% Complexity 21561 21561 =========================================== Files 873 873 Lines 94824 94865 +41 =========================================== Hits 4010 4010 - Misses 90814 90855 +41 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.