Modifier and Type | Field and Description |
---|---|
static CacheKeyGenerator |
INSTANCE |
Constructor and Description |
---|
CacheKeyGenerator() |
Modifier and Type | Method and Description |
---|---|
String |
generateKey(org.apache.hc.core5.http.HttpHost host,
org.apache.hc.core5.http.HttpRequest request)
Computes a key for the given
HttpHost and HttpRequest
that can be used as a unique identifier for cached resources. |
String |
generateKey(org.apache.hc.core5.http.HttpHost host,
org.apache.hc.core5.http.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(org.apache.hc.core5.http.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(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.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(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.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(org.apache.hc.core5.http.HttpRequest req, HttpCacheEntry entry)
req
- originating requestentry
- cache entry in question that has variantsCopyright © 2010–2021 The Apache Software Foundation. All rights reserved.