Skip to content

Proposal: Use a global HttpClient instance for performance optimization #205

@RecursionTaoist

Description

@RecursionTaoist

Since 0.9.0, each HTTP request creates a new HttpClient instance. According to JDK documentation, HttpClient is designed to be immutable and thread-safe, and should be reused throughout the application's lifetime. Initializing a new HttpClient per request can introduce significant overhead.

Proposal: Refactor the internal implementation to use a single global (or session-scoped) HttpClient instance, reused for all requests and redirects unless special configurations (e.g. proxy, SSL context) require otherwise.

Please consider this optimization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions