public static final class CachePolicyProps.Builder
extends java.lang.Object
CachePolicyProps
Constructor and Description |
---|
Builder() |
public CachePolicyProps.Builder cachePolicyName(java.lang.String cachePolicyName)
CachePolicyProps.getCachePolicyName()
cachePolicyName
- A unique name to identify the cache policy.
The name must only include '-', '_', or alphanumeric characters.this
public CachePolicyProps.Builder comment(java.lang.String comment)
CachePolicyProps.getComment()
comment
- A comment to describe the cache policy.this
public CachePolicyProps.Builder cookieBehavior(CacheCookieBehavior cookieBehavior)
CachePolicyProps.getCookieBehavior()
cookieBehavior
- Determines whether any cookies in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin.this
public CachePolicyProps.Builder defaultTtl(Duration defaultTtl)
CachePolicyProps.getDefaultTtl()
defaultTtl
- The default amount of time for objects to stay in the CloudFront cache.
Only used when the origin does not send Cache-Control or Expires headers with the object.this
public CachePolicyProps.Builder enableAcceptEncodingBrotli(java.lang.Boolean enableAcceptEncodingBrotli)
CachePolicyProps.getEnableAcceptEncodingBrotli()
enableAcceptEncodingBrotli
- Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'br'.this
public CachePolicyProps.Builder enableAcceptEncodingGzip(java.lang.Boolean enableAcceptEncodingGzip)
CachePolicyProps.getEnableAcceptEncodingGzip()
enableAcceptEncodingGzip
- Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'gzip'.this
public CachePolicyProps.Builder headerBehavior(CacheHeaderBehavior headerBehavior)
CachePolicyProps.getHeaderBehavior()
headerBehavior
- Determines whether any HTTP headers are included in the cache key and automatically included in requests that CloudFront sends to the origin.this
public CachePolicyProps.Builder maxTtl(Duration maxTtl)
CachePolicyProps.getMaxTtl()
maxTtl
- The maximum amount of time for objects to stay in the CloudFront cache.
CloudFront uses this value only when the origin sends Cache-Control or Expires headers with the object.this
public CachePolicyProps.Builder minTtl(Duration minTtl)
CachePolicyProps.getMinTtl()
minTtl
- The minimum amount of time for objects to stay in the CloudFront cache.this
public CachePolicyProps.Builder queryStringBehavior(CacheQueryStringBehavior queryStringBehavior)
CachePolicyProps.getQueryStringBehavior()
queryStringBehavior
- Determines whether any query strings are included in the cache key and automatically included in requests that CloudFront sends to the origin.this
public CachePolicyProps build()
CachePolicyProps
java.lang.NullPointerException
- if any required attribute was not provided