Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#61358 new enhancement

Add Support to HTTP 2 in WP_Http Class

Reported by: isaumya Owned by:
Priority: normal Milestone: Awaiting Review
Component: HTTP API Version:
Severity: normal Keywords: has-patch
Cc: Focuses: performance

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.


2 years ago

#2 @mukesh27
2 years ago

  • Keywords needs-patch added

This ticket was mentioned in PR #7018 on WordPress/wordpress-develop by @narenin.


2 years ago
#3

  • Keywords has-patch added; needs-patch removed

#4 @peterwilsoncc
2 years 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.

Note: See TracTickets for help on using tickets.