The documentation and help text both state the following:
On the Performance (admin/config/development/performance) page, you can configure how long browsers and proxies may cache pages. That setting is also respected by the Internal Page Cache module.
I read that to mean that if you set the page cache max age (cache.page.max_age
in the system.performance
configuration) to then cached paged responses will not be generated (or at least not served), even if the Internal Page Cache module is on. Likewise, I read that to mean setting this to "1 min" will but an expire time on the cached page responses of 1 minute, but that's not true either.
What this setting does do is simply affect how the cache control headers are set on the response, which affects proxies like Varnish and client caches like a browser cache.
In fact, page cache responses are always set to have an expiration of -1, meaning they will never be invalidated organically over time without some cache purging event. This behavior led to lots of confusion in the community.
There is a large core issue #2526150: Database cache bins allow unlimited growth: cache DB tables of gigabytes! in the works to make page cache entries have an expiration, but the current patch there does not use the max age configuration setting anyway.
I'm suggesting that we update the documentation and help text, and perhaps update the performance form to be clearer about how this setting affects internal page cache behavior.
Comment | File | Size | Author |
---|---|---|---|
#10 | 2862894-internal_page_cache-10.patch | 1.81 KB | fgm |
#8 | 2862894-page_cache_help-7.patch | 1.81 KB | fgm |
#5 | 2862894-page_cache_help.patch | 1.82 KB | fgm |
Comments
Comment #2
Wim LeersClarifying IS slightly.
Comment #3
Wim LeersAgreed.
The reason it always sets
-1
is that responses are assumed to remain the same until a cache tag that is associated with the response gets invalidated. But, of course, browsers/proxies A) generally do not support cache tags, B) we would have no way to inform them all that some cache tag was invalidated.Therefore Page Cache indeed only has one mechanism with which to ensure that browsers/proxies don't cache responses for too long: the "max age" setting in
system.performance
.Agreed that we should update the documentation and help text.
Comment #5
fgmHow about this ?
Comment #6
Wim Leers👍
Comment #7
borisson_which caches pages until permanently until invalidation
does not look right.I think the first until should be removed?
Comment #8
fgmIndeed it should.
Comment #9
catchI'd probably go for 'this setting' or 'the setting' rather than 'that setting', since there's only one setting being talked about.
Comment #10
fgmSo be it.
Comment #11
borisson_Looks good.
Comment #12
plachThis will have to go in 8.5.x first.
Comment #13
plachUnfortunately this is a UI string change so I don't think it can be backported to 8.4.x.
(Also saving credits)
Comment #15
plachCommitted efab31b and pushed to 8.5.x. Thanks!