Problem/Motivation

Ideally, Drupal core could enable persistent transport sharing for HTTP client requests. This allows requests to share connections, DNS, and TLS sessions across multiple PHP executions. For example, batch operations could continue a series of HTTP client requests to the same host without a DNS lookup, reconnecting and renegotiating TLS.

Steps to reproduce

Time the HTTP client requests in e.g. Update Status module, and notice that each time you click "Check manually," ~100ms or so of extra time is spent on the first request. Much of that extra time can be saved if connections are reused across multiple PHP executions.

Proposed resolution

Since guzzle doesn't automatically enable transport sharing when a HandlerStack is built, core could introduce its own HandlerStack factory method to configure this automatically via ['transport_sharing' => \GuzzleHttp\TransportSharing::PERSISTENT_PREFER]

Remaining tasks

Review MR.

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3618392

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mfb created an issue. See original summary.

mfb’s picture

Issue tags: +Performance
mfb’s picture

Issue summary: View changes
catch’s picture

Status: Needs review » Reviewed & tested by the community

This looks good, I can't see anything to complain about.

Should help translation downloads during the multilingual installer too.