Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295826

max-age on HTML responses wrongly set to `max-age=0, private` instead of `max-age=N, public`

$
0
0

Problem/Motivation

See #606840-92: Enable internal page cache by default, plus comments #95, #96 and #97.

Caused by #2443073: Add #cache[max-age] to disable caching and bubble the max-age's adding of

<?php
   
// If an explicit non-infinite max-age is specified by a part of the page,
    // respect that by applying it to the response's headers.
   
if ($cache_max_age !== Cache::PERMANENT) {
     
$response->setMaxAge($cache_max_age);
    }
?>

Which only was possible due to lacking test coverage.

Critical because:

That completely breaks reverse proxies? And If that's not a release-blocking bug, then I don't know what is? :)

(@Berdir in #606840-96: Enable internal page cache by default)

Proposed resolution

Revert that hunk and add test coverage. This is what @Berdir proposed in #606840-96: Enable internal page cache by default:

The max_age setting and the max-age bubbling seem to contradict each other, and we know that bubbling doesn't actually work yet, as long as many things are still setting max-age: 0. So I think we should disable that setMaxAge() until we know that it actually works as expected *and* is implemented in a way that doesn't break the other headers? Which we should probably be set unconditionally anyway? And then we can also remove the global max_age setting.

Remaining tasks

Do it.

User interface changes

None.

API changes

None.


Viewing all articles
Browse latest Browse all 295826

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>