Modifier and Type | Field and Description |
---|---|
static CacheKeyGenerator |
INSTANCE |
Constructor and Description |
---|
CacheKeyGenerator() |
Modifier and Type | Method and Description |
---|---|
String |
generateKey(HttpHost host,
HttpRequest request)
Computes a key for the given
HttpHost and HttpRequest
that can be used as a unique identifier for cached resources. |
String |
generateKey(HttpHost host,
HttpRequest request,
HttpCacheEntry entry)
Computes a key for the given
HttpHost and HttpRequest
that can be used as a unique identifier for cached resources. |
String |
generateKey(URI requestUri)
Computes a key for the given request
URI that can be used as
a unique identifier for cached resources. |
String |
generateVariantKey(HttpRequest req,
HttpCacheEntry entry)
Computes a "variant key" from the headers of a given request that are
covered by the Vary header of a given cache entry.
|
String |
resolve(URI uri) |
public static final CacheKeyGenerator INSTANCE
public String generateKey(URI requestUri)
URI
that can be used as
a unique identifier for cached resources. The URI is expected to
in an absolute form.requestUri
- request URIpublic String generateKey(HttpHost host, HttpRequest request)
HttpHost
and HttpRequest
that can be used as a unique identifier for cached resources.host
- The host for this requestrequest
- the HttpRequest
public String generateKey(HttpHost host, HttpRequest request, HttpCacheEntry entry)
HttpHost
and HttpRequest
that can be used as a unique identifier for cached resources. if the request has a
VARY header the identifier will also include variant key.host
- The host for this requestrequest
- the HttpRequest
entry
- the parent entry used to track the variantspublic String generateVariantKey(HttpRequest req, HttpCacheEntry entry)
req
- originating requestentry
- cache entry in question that has variantsCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.