mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[GH-ISSUE #14673] feat: improve http client performance by reusing connections #32860
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cambriancoder on GitHub (Jun 4, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14673
Check Existing Issues
Problem Description
The backend currently initiates a new session for each HTTP request, leading to inefficiencies and increased latency due to repeated connection creation. To enhance performance, I propose implementing a global session for the
requestsandaiohttpHTTP clients, enabling a shared, reusable connection across the application.See:
requests: https://requests.readthedocs.io/en/latest/user/advanced/#session-objectsaiohttp: https://docs.aiohttp.org/en/stable/http_request_lifecycle.html#how-to-use-the-clientsessionAdditionally, some users may need to send client certificates as part of their HTTP requests. To support this, I propose introducing a configuration option that allows specifying a client certificate and private key for the HTTP clients.
Desired Solution you'd like
As above. I will raise a PR with the changes.
Alternatives Considered
No response
Additional Context
No response