Skip to content

[HttpKernel][HttpClient] CachingHttpClient should be configurable as a private cache #36858

Open
@mpdude

Description

@mpdude

The CachingHttpClient internally uses HttpCache. That class, however, has been designed as a public (shared; surrogate) cache.

In this "downstream" caching use case, however, it would be valuable if we

  • could make the cache store private responses, possibly even by default,
  • enforce a "greedy" caching strategy, i. e. a minimum TTL to apply regardless of what the upstream server sent
  • support stale-while-revalidate behavior 🆒

Client-side caching in the HttpClient is useful in µService architectures where you possibly hit a lot of backend APIs; stale-while-revalidate and stale-if-error may further improve performance or even save the day when a backend service goes down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions