I have searched the existing issues and discussions.
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 requests and aiohttp HTTP clients, enabling a shared, reusable connection across the application.
Additionally, 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
Originally created by @cambriancoder on GitHub (Jun 4, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14673
### Check Existing Issues
- [x] I have searched the existing issues and discussions.
### 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 `requests` and `aiohttp` HTTP clients, enabling a shared, reusable connection across the application.
See:
`requests`: https://requests.readthedocs.io/en/latest/user/advanced/#session-objects
`aiohttp`: https://docs.aiohttp.org/en/stable/http_request_lifecycle.html#how-to-use-the-clientsession
Additionally, 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_
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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