A Cache Policy configuration.
import { CachePolicy } from 'aws-cdk-lib/aws-cloudfront';Or use the module namespace:
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
// cloudfront.CachePolicyConfiguration passed to the constructor as CachePolicyProps.
cachePolicyNameOptionalstringA unique name to identify the cache policy. The name must only include '-', '_', or alphanumeric characters.
Default: - generated from the `id`
commentOptionalstringA comment to describe the cache policy. The comment cannot be longer than 128 characters.
Default: - no comment
cookieBehaviorOptionalCacheCookieBehaviorDetermines whether any cookies in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin.
Default: CacheCookieBehavior.none()
defaultTtlOptionalDurationThe 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.
Default: - The greater of 1 day and ``minTtl``
enableAcceptEncodingBrotliOptionalbooleanWhether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'br'.
Default: false
enableAcceptEncodingGzipOptionalbooleanWhether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'gzip'.
Default: false
headerBehaviorOptionalCacheHeaderBehaviorDetermines whether any HTTP headers are included in the cache key and automatically included in requests that CloudFront sends to the origin.
Default: CacheHeaderBehavior.none()
maxTtlOptionalDurationThe 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.
Default: - The greater of 1 year and ``defaultTtl``
minTtlOptionalDurationThe minimum amount of time for objects to stay in the CloudFront cache.
Default: Duration.seconds(0)
queryStringBehaviorOptionalCacheQueryStringBehaviorDetermines whether any query strings are included in the cache key and automatically included in requests that CloudFront sends to the origin.
Default: CacheQueryStringBehavior.none()
Everything you need to know about Amazon CloudFront on one page. HD quality, print-friendly.
Download Free Infographicaws-cloudfront