public final class CachePolicy
extends com.google.api.client.json.GenericJson
This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the Compute Engine API. For a detailed explanation see: https://developers.google.com/api-client-library/java/google-http-java-client/json
com.google.api.client.util.GenericData.FlagsAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
CachePolicy() |
| Modifier and Type | Method and Description |
|---|---|
CachePolicy |
clone() |
List<String> |
getCacheBypassRequestHeaderNames()
Bypass the cache when the specified request headers are matched by name, e.g.
|
CachePolicyCacheKeyPolicy |
getCacheKeyPolicy()
The cache key configuration.
|
String |
getCacheMode()
Specifies the cache setting for all responses from this route.
|
Duration |
getClientTtl()
Specifies a separate client (e.g.
|
Duration |
getDefaultTtl()
Specifies the default TTL for cached content for responses that do not have an existing valid
TTL (max-age or s-maxage).
|
Duration |
getMaxTtl()
Specifies the maximum allowed TTL for cached content.
|
Boolean |
getNegativeCaching()
Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching
for common errors or redirects.
|
List<CachePolicyNegativeCachingPolicy> |
getNegativeCachingPolicy()
Sets a cache TTL for the specified HTTP status code.
|
Boolean |
getRequestCoalescing()
If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number
of requests to the origin.
|
Duration |
getServeWhileStale()
Serve existing content from the cache (if available) when revalidating content with the origin,
or when an error is encountered when refreshing the cache.
|
CachePolicy |
set(String fieldName,
Object value) |
CachePolicy |
setCacheBypassRequestHeaderNames(List<String> cacheBypassRequestHeaderNames)
Bypass the cache when the specified request headers are matched by name, e.g.
|
CachePolicy |
setCacheKeyPolicy(CachePolicyCacheKeyPolicy cacheKeyPolicy)
The cache key configuration.
|
CachePolicy |
setCacheMode(String cacheMode)
Specifies the cache setting for all responses from this route.
|
CachePolicy |
setClientTtl(Duration clientTtl)
Specifies a separate client (e.g.
|
CachePolicy |
setDefaultTtl(Duration defaultTtl)
Specifies the default TTL for cached content for responses that do not have an existing valid
TTL (max-age or s-maxage).
|
CachePolicy |
setMaxTtl(Duration maxTtl)
Specifies the maximum allowed TTL for cached content.
|
CachePolicy |
setNegativeCaching(Boolean negativeCaching)
Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching
for common errors or redirects.
|
CachePolicy |
setNegativeCachingPolicy(List<CachePolicyNegativeCachingPolicy> negativeCachingPolicy)
Sets a cache TTL for the specified HTTP status code.
|
CachePolicy |
setRequestCoalescing(Boolean requestCoalescing)
If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number
of requests to the origin.
|
CachePolicy |
setServeWhileStale(Duration serveWhileStale)
Serve existing content from the cache (if available) when revalidating content with the origin,
or when an error is encountered when refreshing the cache.
|
getFactory, setFactory, toPrettyString, toStringentrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeysclear, containsKey, containsValue, isEmpty, keySet, size, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic List<String> getCacheBypassRequestHeaderNames()
null for nonepublic CachePolicy setCacheBypassRequestHeaderNames(List<String> cacheBypassRequestHeaderNames)
cacheBypassRequestHeaderNames - cacheBypassRequestHeaderNames or null for nonepublic CachePolicyCacheKeyPolicy getCacheKeyPolicy()
null for nonepublic CachePolicy setCacheKeyPolicy(CachePolicyCacheKeyPolicy cacheKeyPolicy)
cacheKeyPolicy - cacheKeyPolicy or null for nonepublic String getCacheMode()
null for nonepublic CachePolicy setCacheMode(String cacheMode)
cacheMode - cacheMode or null for nonepublic Duration getClientTtl()
null for nonepublic CachePolicy setClientTtl(Duration clientTtl)
clientTtl - clientTtl or null for nonepublic Duration getDefaultTtl()
null for nonepublic CachePolicy setDefaultTtl(Duration defaultTtl)
defaultTtl - defaultTtl or null for nonepublic Duration getMaxTtl()
null for nonepublic CachePolicy setMaxTtl(Duration maxTtl)
maxTtl - maxTtl or null for nonepublic Boolean getNegativeCaching()
null for nonepublic CachePolicy setNegativeCaching(Boolean negativeCaching)
negativeCaching - negativeCaching or null for nonepublic List<CachePolicyNegativeCachingPolicy> getNegativeCachingPolicy()
null for nonepublic CachePolicy setNegativeCachingPolicy(List<CachePolicyNegativeCachingPolicy> negativeCachingPolicy)
negativeCachingPolicy - negativeCachingPolicy or null for nonepublic Boolean getRequestCoalescing()
null for nonepublic CachePolicy setRequestCoalescing(Boolean requestCoalescing)
requestCoalescing - requestCoalescing or null for nonepublic Duration getServeWhileStale()
null for nonepublic CachePolicy setServeWhileStale(Duration serveWhileStale)
serveWhileStale - serveWhileStale or null for nonepublic CachePolicy set(String fieldName, Object value)
set in class com.google.api.client.json.GenericJsonpublic CachePolicy clone()
clone in class com.google.api.client.json.GenericJsonCopyright © 2011–2026 Google. All rights reserved.