Opened 8 months ago
Last modified 7 months ago
#61358 new enhancement
Add Support to HTTP 2 in WP_Http Class
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | HTTP API | Keywords: | has-patch |
Focuses: | performance | Cc: |
Description
As HTTP 2 has become the standard of the web and HTTP 3 deployment is increasing rapidly, WP_Http
class should support HTTP/2.0 in httpversion
which currently only accepts 1.0
or 1.1
.
The httpversion
should accept 1.0
, 1.1
, 2.0
, and 3.0
and the default should be 2.0
instead of 1.0
or 1.1
standing in 2024.
There is no way to make requests via HTTP/2 in WordPress unless a custom cURL-based approach is used. This should be fixed.
Change History (4)
This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.
7 months ago
This ticket was mentioned in PR #7018 on WordPress/wordpress-develop by @narenin.
7 months ago
#3
- Keywords has-patch added; needs-patch removed
#4
@
7 months ago
As WordPress server-side requests are typically for a single file (most likely a JSON API), it would be good to figure out if it's best to default to HTTP 1.1 or HTTP 2.
My, possibly out of date, understanding is that there is an additional round trip made to the server for an HTTP 2 request. In browsers this is fine as multiplexing improves the response time for associated assets. If requesting a single file, HTTP 1.1 may be marginally quicker as there is no need for the upgrade round trip.
I agree that supporting HTTP 2 is the class is a good idea though.
Trac ticket: https://core.trac.wordpress.org/ticket/61358