Skip to content

Support gzip in httpclient requests made on platform-server (with Universal) #46930

@amakhrov

Description

@amakhrov

Which @angular/* package(s) are relevant/related to the feature request?

platform-server

Description

HttpClient on platform-server uses node-xhr2 under the hood. As such it doesn't support content compression (pwnall/node-xhr2#17).
While it might not be the greatest problem for requests made within the same datacenter (to our own apis), it impacts requests to external apis.
Also it negatively impacts local development experience (via npm run dev:ssr).

There is a related issue in the angular/universal repo - closed due to lack of support form the underlying node-xhr2 library. On the other hand, that library might never support it if no interest is expressed from the Angular team. Also the node-xhr2 author actually mentioned they currently work on Google - which can make it easier to make a case for adding this feature.

Proposed solution

Implement gzip support in the underlying node-xhr2 library, update the dependency in Angular.

Alternatives considered

  • Roll our own implementation / fork of node-xhr
  • Use some other xhr-compatible node implementation (node-xhr2 doesn't seem to be actively maintained anyway)

Metadata

Metadata

Assignees

Labels

area: serverIssues related to server-side renderingfeatureIssue that requests a new featurefeature: in backlogFeature request for which voting has completed and is now in the backlog

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions