Honor qualified Cache-Control: private="field" in a shared cache (RFC9111 section 5.2.2.7) - #868
Open
arturobernalg wants to merge 1 commit into
Open
Conversation
arturobernalg
force-pushed
the
cache-qualified-private
branch
from
August 12, 2026 15:12
7e9ca32 to
e07363a
Compare
ok2c
reviewed
Aug 16, 2026
|
|
||
| @Test | ||
| void testParseMultiplePrivateDirectivesAccumulate() { | ||
| final Header header = new BasicHeader("Cache-Control", "private=\"X-A\", private=\"X-B\", s-maxage=3600"); |
Member
There was a problem hiding this comment.
@arturobernalg What part of the spec actually defines or recommends such behavior? In my opinion only private=\"X-B\" should have an effect.
ok2c
reviewed
Aug 16, 2026
| import java.util.concurrent.atomic.AtomicInteger; | ||
|
|
||
| import com.sun.net.httpserver.HttpExchange; | ||
| import com.sun.net.httpserver.HttpServer; |
… 9111 section 5.2.2.7) A shared cache now stores a response that carries a qualified private directive with the named header fields removed from the stored copy, instead of treating the whole response as non-cacheable, while the response returned to the caller retains those fields. The fields are removed from freshly stored entries, from entries updated by a 304 revalidation, and from the root entry of a Vary response. A bare private directive still makes the whole response non-storable by a shared cache, and multiple qualified private directives accumulate their field names.
arturobernalg
force-pushed
the
cache-qualified-private
branch
from
August 16, 2026 17:32
e07363a to
a501878
Compare
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.
A shared cache now stores a response that carries a qualified private directive with the named header fields removed from the stored copy, instead of treating the whole response as
non-cacheable, while the response returned to the caller retains those fields. The fields are removed from freshly stored entries, from entries updated by a 304 revalidation, and from the root entry of a Vary response. A bare private directive still makes the whole responsenon-storableby a shared cache, and multiple qualified private directives accumulate their field names.