FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Backport 22.0.X] skip transfer cache for credentialed requests and uncacheable request/responses by SkyZeroZx · Pull Request #69316 · angular/angular · GitHub

[Backport 22.0.X] skip transfer cache for credentialed requests and uncacheable request/responses - #69316

Closed
SkyZeroZx wants to merge 3 commits into
angular:22.0.xfrom
SkyZeroZx:backport-69017-22.0.x
Closed

[Backport 22.0.X] skip transfer cache for credentialed requests and uncacheable request/responses#69316
SkyZeroZx wants to merge 3 commits into
angular:22.0.xfrom
SkyZeroZx:backport-69017-22.0.x

Conversation

Copy link
Copy Markdown
Contributor

Backport of #69017

Treat HttpClient requests using `credentials: 'include'` and `same-origin` as credentialed
when deciding whether a response can be stored in the HTTP transfer cache.

The transfer cache already skips requests with `withCredentials`, `Cookie`,
`Authorization`, or `Proxy-Authorization` because those responses may contain
user-specific data. Fetch-backed requests can express the same credentialed
behavior through the `credentials` option, so these responses must not be
serialized into the SSR HTML.

This keeps credentialed SSR responses out of TransferState and aligns the
cache eligibility check with the fetch request options supported by HttpClient.
Do not store HTTP transfer cache entries when either the request or response
uses `Cache-Control: no-store`, `Cache-Control: private`, or
`Cache-Control: no-cache`.

Also skip transfer cache when requests use the Fetch API `cache` option with
`no-store` or `no-cache`.

Because transfer cache serializes SSR HTTP responses into the rendered HTML,
Angular now treats these directives conservatively to avoid exposing sensitive
or explicitly uncacheable data through `TransferState`.
pullapprove Bot requested a review from atscott June 11, 2026 15:00
angular-robot Bot added area: common/http Issues related to HTTP and HTTP Client area: common Issues related to APIs in the @angular/common package labels Jun 11, 2026
ngbot Bot added this to the Backlog milestone Jun 11, 2026
JeanMeche removed the request for review from atscott June 11, 2026 15:34
JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jun 11, 2026
thePunderWoman pushed a commit that referenced this pull request Jun 11, 2026
Treat HttpClient requests using `credentials: 'include'` and `same-origin` as credentialed
when deciding whether a response can be stored in the HTTP transfer cache.

The transfer cache already skips requests with `withCredentials`, `Cookie`,
`Authorization`, or `Proxy-Authorization` because those responses may contain
user-specific data. Fetch-backed requests can express the same credentialed
behavior through the `credentials` option, so these responses must not be
serialized into the SSR HTML.

This keeps credentialed SSR responses out of TransferState and aligns the
cache eligibility check with the fetch request options supported by HttpClient.

PR Close #69316
thePunderWoman pushed a commit that referenced this pull request Jun 11, 2026
Do not store HTTP transfer cache entries when either the request or response
uses `Cache-Control: no-store`, `Cache-Control: private`, or
`Cache-Control: no-cache`.

Also skip transfer cache when requests use the Fetch API `cache` option with
`no-store` or `no-cache`.

Because transfer cache serializes SSR HTTP responses into the rendered HTML,
Angular now treats these directives conservatively to avoid exposing sensitive
or explicitly uncacheable data through `TransferState`.

PR Close #69316

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jul 12, 2026
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: common/http Issues related to HTTP and HTTP Client area: common Issues related to APIs in the @angular/common package target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL