Skip to content

[HttpClient] Explain how to enable HTTP encoding ("Accept-Encoding" header) #17216

Closed
@ThomasLandauer

Description

@ThomasLandauer

@nicolas-grekas Just noticed that (by default) HttpClient doesn't support compression. I think this should be emphasized more in the docs, since it's an easy (?) way to speed things up, isn't it?

https://symfony.com/doc/current/http_client.html#making-requests

HTTP compression and chunked transfer encoding are automatically enabled when both your PHP runtime and the remote server support them.

Some questions I'd like to expand on (but don't know the answers):

  1. "HTTP compression" refers to an "Accept-Encoding" HTTP header being sent in the request?
  2. How can I check what my PHP runtime supports?
  3. If HttpClient comes to the conclusion that my PHP supports gzip and deflate, it will send?:

    Accept-Encoding: gzip, deflate

  4. Since Transfer-Encoding is dead in HTTP/2, it's probably not so important to give more details about it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions