Giter VIP home page Giter VIP logo

Comments (11)

cssjoe avatar cssjoe commented on August 17, 2024

@jamieburchell We will look into adding more information on the settings page to inform users of the max value. You can override the max value by adding a definition for W3TC_CACHE_FILE_EXPIRE_MAX in your wp-config.php file.

from w3-total-cache.

jamieburchell avatar jamieburchell commented on August 17, 2024

Thanks @cssjoe. I did just that to resolve it.
Why is an upper limit necessary at all?

from w3-total-cache.

DaanG47 avatar DaanG47 commented on August 17, 2024

I also experience this problem. Page cache is set to a year, but when the cron "w3_pgcache_cleanup" runs, all cache is purged.
W3 Total Cache Version 2.7.1

from w3-total-cache.

jamieburchell avatar jamieburchell commented on August 17, 2024

Thanks @cssjoe !

You mention a further bug where a field is hidden when the cache is Disk (Enhanced). How does the value of that previously hidden field relate to the browser cache expiry value?

from w3-total-cache.

cssjoe avatar cssjoe commented on August 17, 2024

@jamieburchell Another one of our devs worked on #870 where the Page Cache lifetime setting was hidden but still used when using the Page Cache "Disk Enhanced" engine. There is a relation between the page cache lifetime and what is used for the browser cache Expires headers. We try to sync the lifetime so that browsers will get a new copy after the page cache expires.

from w3-total-cache.

jamieburchell avatar jamieburchell commented on August 17, 2024

@cssjoe So does the newly visible field override the value set for the browser cache lifetime in respect of the disk cache expiry?

from w3-total-cache.

cssjoe avatar cssjoe commented on August 17, 2024

@jamieburchell I was mistaken. The Browse Cache ExpiresByType headers for pages are controlled by browsercache.html.expires and browsercache.html.lifetime.

from w3-total-cache.

jamieburchell avatar jamieburchell commented on August 17, 2024

@cssjoe Yes but browsercache.html.lifetime was also used as the expiry for the disk cache files. Is that no longer the case?

from w3-total-cache.

cssjoe avatar cssjoe commented on August 17, 2024

@jamieburchell That code was written before I was a part of the project. It appears that browsercache.html.lifetime is used for manual cleanup for Page Cache when using Disk Enhanced.

from w3-total-cache.

jamieburchell avatar jamieburchell commented on August 17, 2024

@cssjoe So one setting applies during cleanup but another controls expiry of the cache file? I'm confused 😊

from w3-total-cache.

jamieburchell avatar jamieburchell commented on August 17, 2024

@jamieburchell That code was written before I was a part of the project. It appears that browsercache.html.lifetime is used for manual cleanup for Page Cache when using Disk Enhanced.

@cssjoe Now that I see an input field for pgcache.lifetime in the settings, I'm thinking this line should reference that rather than browsercache.html.lifetime ?

There's also something strange here a) the $_expire property is never used in this class and b) it is inconsistent with how it is initialised elsewhere:

if ( !$this->_expire || $this->_expire > W3TC_CACHE_FILE_EXPIRE_MAX ) {
	$this->_expire = W3TC_CACHE_FILE_EXPIRE_MAX;
}
if ( ! $this->_expire ) {
	$this->_expire = 0;
} elseif ( $this->_expire > W3TC_CACHE_FILE_EXPIRE_MAX ) {
	$this->_expire = W3TC_CACHE_FILE_EXPIRE_MAX;
}
if ( $expire <= 0 || $expire > W3TC_CACHE_FILE_EXPIRE_MAX )
	$expire = W3TC_CACHE_FILE_EXPIRE_MAX;

from w3-total-cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.