docs(performance): document HEAD request body-skip optimization#2312
Open
soyuka wants to merge 1 commit into
Open
docs(performance): document HEAD request body-skip optimization#2312soyuka wants to merge 1 commit into
soyuka wants to merge 1 commit into
Conversation
HEAD requests now skip response body construction by default (the collection is never iterated and serialization is skipped). This changes observable behavior: Content-Length is no longer set, and Cache-Tag/xkey headers are no longer emitted on HEAD responses. Document the enable_head_request_optimization flag (Symfony and Laravel) to restore the previous GET-equivalent behavior, and note that the Allow header no longer advertises HEAD without a GET operation.
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.
Documents the HEAD request body-skip optimization introduced in api-platform/core#8348 (ships in 4.4).
What
On
HEADrequests, API Platform no longer builds the response body: the collection is never iterated (no row SELECT) and serialization is skipped. Enabled by default.Two observable changes vs. previous GET-equivalent HEAD handling:
Content-Lengthno longer set on HEAD (RFC 9110 §9.3.2).xkeyheaders no longer emitted on HEAD (previously tag-purgeable; now TTL-only).Plus:
Allowheader no longer advertisesHEADfor resources without aGEToperation.Changes
core/performance.md: new HEAD Request Optimization section — behavior, BC-relevant changes, and how to disable (Symfony + Laravel).core/configuration.md: addedenable_head_request_optimization(defaulttrue) to both the Symfony and Laravel config references.Depends on api-platform/core#8348.