@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)",
date="2023-01-31T18:36:56.850Z")
public interface CachePolicyProps
Example:
// Creating a custom cache policy for a Distribution -- all parameters optional S3Origin bucketOrigin; CachePolicy myCachePolicy = CachePolicy.Builder.create(this, "myCachePolicy") .cachePolicyName("MyPolicy") .comment("A default policy") .defaultTtl(Duration.days(2)) .minTtl(Duration.minutes(1)) .maxTtl(Duration.days(10)) .cookieBehavior(CacheCookieBehavior.all()) .headerBehavior(CacheHeaderBehavior.allowList("X-CustomHeader")) .queryStringBehavior(CacheQueryStringBehavior.denyList("username")) .enableAcceptEncodingGzip(true) .enableAcceptEncodingBrotli(true) .build(); Distribution.Builder.create(this, "myDistCustomPolicy") .defaultBehavior(BehaviorOptions.builder() .origin(bucketOrigin) .cachePolicy(myCachePolicy) .build()) .build();
Modifier and Type | Interface and Description |
---|---|
static class |
CachePolicyProps.Builder
A builder for
CachePolicyProps |
static class |
CachePolicyProps.Jsii$Proxy
An implementation for
CachePolicyProps |
Modifier and Type | Method and Description |
---|---|
static CachePolicyProps.Builder |
builder() |
default java.lang.String |
getCachePolicyName()
A unique name to identify the cache policy.
|
default java.lang.String |
getComment()
A comment to describe the cache policy.
|
default CacheCookieBehavior |
getCookieBehavior()
Determines whether any cookies in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
default Duration |
getDefaultTtl()
The default amount of time for objects to stay in the CloudFront cache.
|
default java.lang.Boolean |
getEnableAcceptEncodingBrotli()
Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'br'.
|
default java.lang.Boolean |
getEnableAcceptEncodingGzip()
Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'gzip'.
|
default CacheHeaderBehavior |
getHeaderBehavior()
Determines whether any HTTP headers are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
default Duration |
getMaxTtl()
The maximum amount of time for objects to stay in the CloudFront cache.
|
default Duration |
getMinTtl()
The minimum amount of time for objects to stay in the CloudFront cache.
|
default CacheQueryStringBehavior |
getQueryStringBehavior()
Determines whether any query strings are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
default java.lang.String getCachePolicyName()
The name must only include '-', '_', or alphanumeric characters.
Default: - generated from the `id`
default java.lang.String getComment()
Default: - no comment
default CacheCookieBehavior getCookieBehavior()
Default: CacheCookieBehavior.none()
default Duration getDefaultTtl()
Only used when the origin does not send Cache-Control or Expires headers with the object.
Default: - The greater of 1 day and ``minTtl``
default java.lang.Boolean getEnableAcceptEncodingBrotli()
Default: false
default java.lang.Boolean getEnableAcceptEncodingGzip()
Default: false
default CacheHeaderBehavior getHeaderBehavior()
Default: CacheHeaderBehavior.none()
default Duration getMaxTtl()
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``
default Duration getMinTtl()
Default: Duration.seconds(0)
default CacheQueryStringBehavior getQueryStringBehavior()
Default: CacheQueryStringBehavior.none()
static CachePolicyProps.Builder builder()
CachePolicyProps.Builder
of CachePolicyProps