Problem/Motivation

It looks like the 5xx cache maximum age setting doesn't actually do anything. Even if you explicitly create a cacheable 500 response like this:

return new CacheableResponse(status: 500);

there's Drupal\Core\PageCache\ResponsePolicy\NoServerError that marks the request as non-cacheable.

The only way for this setting to take effect would be if the page_cache_no_server_error service would be removed through a service modifier. That's such a niche situation that I don't think it's worth supporting.

Proposed resolution

Remove the setting.

CommentFileSizeAuthor
#9 http_cache_control-3527918-1.patch578 bytesrtkr
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dieterholvoet created an issue. See original summary.

dieterholvoet’s picture

Issue summary: View changes
Status: Active » Needs review

  • dieterholvoet committed fc940fd5 on 8.x-2.x
    Issue #3527918 by dieterholvoet: The 5xx cache maximum age setting doesn...
dieterholvoet’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rtkr made their first commit to this issue’s fork.

rtkr’s picture

StatusFileSize
new578 bytes

The hook update http_cache_control_update_8103 doesn't remove 5xx_max_age correctly. I've created merge request with correct key.

dieterholvoet’s picture

Status: Closed (fixed) » Needs work

My bad! This update hook is already released though, so we'll need to add a new one instead of change the existing one.

dieterholvoet changed the visibility of the branch 8.x-2.x to hidden.

  • dieterholvoet committed 7f3bf13f on 8.x-2.x authored by rtkr
    Issue #3527918 by dieterholvoet, rtkr: The 5xx cache maximum age setting...
dieterholvoet’s picture

Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.