harp_apps.http_cache.transports

Inheritance diagram of harp_apps.http_cache.transports

class AsyncCacheTransport[source]

Bases: AsyncCacheTransport

async handle_async_request(request)[source]

Wraps the request to use a rewritten url (for cache key handling).

Parameters:

request (Request)

Return type:

Response

async request_sender(request)[source]

Unwraps the request before sending it, and drops the upstream’s connection-specific fields.

This is the last point at which Connection can still be read. Further down, hishel removes Connection itself and leaves the fields it named behind, so by the time the proxy controller sees a cached response there is nothing left to identify them by and RFC 9110 §7.6.1 cannot be applied. Dropping them here also means they are never written to the cache, which is what RFC 9111 §3.1 asks for.

content-length is deliberately kept: it describes the body being stored, and the controller drops it on the way out to the client anyway.

Parameters:

request (WrappedRequest)

Return type:

Response