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

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

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

Merged
atscott merged 2 commits into
angular:21.2.xfrom
SkyZeroZx:fix/21-transfercache
Jun 4, 2026
Merged

[Backport 21.2.X] skip transfer cache for credentialed requests and uncacheable request/responses#69098
atscott merged 2 commits into
angular:21.2.xfrom
SkyZeroZx:fix/21-transfercache

Conversation

Copy link
Copy Markdown
Contributor

Backport of #69017

SkyZeroZx added 2 commits June 2, 2026 13:50
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.

(cherry picked from commit 8ec0197)
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`.

(cherry picked from commit 4d15015)

(cherry picked from commit 64ce11f)
pullapprove Bot requested a review from JeanMeche June 2, 2026 19:02
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 2, 2026
ngbot Bot added this to the Backlog milestone Jun 2, 2026
JeanMeche added action: merge The PR is ready for merge by the caretaker target: lts This PR is targeting a version currently in long-term support and removed target: lts This PR is targeting a version currently in long-term support labels Jun 2, 2026
atscott merged commit d846326 into angular:21.2.x Jun 4, 2026
27 checks passed

atscott commented Jun 4, 2026

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 5, 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: lts This PR is targeting a version currently in long-term support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL