Merged
Conversation
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.1.0...4.1.1) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…s middleware
WordPress calls PHP's native header() via nocache_headers(), which stores
`no-cache, no-store, must-revalidate, max-age=0` in the PHP native header
queue — not in Symfony's header bag.
When shouldSetPublicCache() was true (unauthenticated users), the middleware
called addCacheControlDirective('must-revalidate') on top of the WordPress
headers already queued natively. Since Symfony sends its headers with
replace=false (except Content-Type), both Cache-Control values coexisted and
were concatenated by the browser, resulting in:
Cache-Control: no-cache, must-revalidate, max-age=0, public, max-age=3600, must-revalidate
Fix: before rebuilding the public cache directives, flush Cache-Control at
both levels:
- header_remove('Cache-Control') clears the PHP native queue (WordPress headers)
- $response->headers->remove('Cache-Control') clears the Symfony bag
The resulting header for unauthenticated users is now clean:
Cache-Control: public, must-revalidate, max-age=3600
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.