@Stability(value=Experimental) public static final class CachePolicy.Builder extends Object implements software.amazon.jsii.Builder<CachePolicy>
CachePolicy.| Modifier and Type | Method and Description |
|---|---|
CachePolicy |
build() |
CachePolicy.Builder |
cachePolicyName(String cachePolicyName)
(experimental) A unique name to identify the cache policy.
|
CachePolicy.Builder |
comment(String comment)
(experimental) A comment to describe the cache policy.
|
CachePolicy.Builder |
cookieBehavior(CacheCookieBehavior cookieBehavior)
(experimental) Determines whether any cookies in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
static CachePolicy.Builder |
create(software.constructs.Construct scope,
String id) |
CachePolicy.Builder |
defaultTtl(Duration defaultTtl)
(experimental) The default amount of time for objects to stay in the CloudFront cache.
|
CachePolicy.Builder |
enableAcceptEncodingBrotli(Boolean enableAcceptEncodingBrotli)
(experimental) Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'br'.
|
CachePolicy.Builder |
enableAcceptEncodingGzip(Boolean enableAcceptEncodingGzip)
(experimental) Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'gzip'.
|
CachePolicy.Builder |
headerBehavior(CacheHeaderBehavior headerBehavior)
(experimental) Determines whether any HTTP headers are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
CachePolicy.Builder |
maxTtl(Duration maxTtl)
(experimental) The maximum amount of time for objects to stay in the CloudFront cache.
|
CachePolicy.Builder |
minTtl(Duration minTtl)
(experimental) The minimum amount of time for objects to stay in the CloudFront cache.
|
CachePolicy.Builder |
queryStringBehavior(CacheQueryStringBehavior queryStringBehavior)
(experimental) Determines whether any query strings are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
@Stability(value=Experimental) public static CachePolicy.Builder create(software.constructs.Construct scope, String id)
scope - This parameter is required.id - This parameter is required.CachePolicy.Builder.@Stability(value=Experimental) public CachePolicy.Builder cachePolicyName(String cachePolicyName)
The name must only include '-', '_', or alphanumeric characters.
Default: - generated from the `id`
cachePolicyName - A unique name to identify the cache policy. This parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder comment(String comment)
Default: - no comment
comment - A comment to describe the cache policy. This parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder cookieBehavior(CacheCookieBehavior cookieBehavior)
Default: CacheCookieBehavior.none()
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 parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder defaultTtl(Duration defaultTtl)
Only used when the origin does not send Cache-Control or Expires headers with the object.
Default: - The greater of 1 day and ``minTtl``
defaultTtl - The default amount of time for objects to stay in the CloudFront cache. This parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder enableAcceptEncodingBrotli(Boolean enableAcceptEncodingBrotli)
Default: false
enableAcceptEncodingBrotli - Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'br'. This parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder enableAcceptEncodingGzip(Boolean enableAcceptEncodingGzip)
Default: false
enableAcceptEncodingGzip - Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'gzip'. This parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder headerBehavior(CacheHeaderBehavior headerBehavior)
Default: CacheHeaderBehavior.none()
headerBehavior - Determines whether any HTTP headers are included in the cache key and automatically included in requests that CloudFront sends to the origin. This parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder maxTtl(Duration maxTtl)
CloudFront uses this value only when the origin sends Cache-Control or Expires headers with the object.
Default: - The greater of 1 year and ``defaultTtl``
maxTtl - The maximum amount of time for objects to stay in the CloudFront cache. This parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder minTtl(Duration minTtl)
Default: Duration.seconds(0)
minTtl - The minimum amount of time for objects to stay in the CloudFront cache. This parameter is required.this@Stability(value=Experimental) public CachePolicy.Builder queryStringBehavior(CacheQueryStringBehavior queryStringBehavior)
Default: CacheQueryStringBehavior.none()
queryStringBehavior - Determines whether any query strings are included in the cache key and automatically included in requests that CloudFront sends to the origin. This parameter is required.this@Stability(value=Experimental) public CachePolicy build()
build in interface software.amazon.jsii.Builder<CachePolicy>Copyright © 2021. All rights reserved.