Package net.targetr.wtm3.net.http.proxy.cache


package net.targetr.wtm3.net.http.proxy.cache
Basic in-memory caching of responses from upstream HTTP targets.

CachingProxy checks the shared SimpleCache before opening an upstream connection. On a miss, CachingProxyResponse captures the streamed headers and body and stores them after the response is written.

Entries are keyed by target URL and expire after the caller-supplied maximum age. The cache accounts for stored body bytes, removes expired entries and evicts least-recently-accessed entries when over its configured size limit. It does not partition entries by request headers or user identity, so callers must select targets whose responses are suitable for sharing by URL.

Author:
Dr Michael Gardiner
  • Classes
    Class
    Description
    A proxy that caches responses from target servers to avoid repeated network requests.
    Streams a response to a client from another connection while caching the response data
    A simple, thread-safe in-memory cache for HTTP responses.
    Represents a cached response entry.