CloudFront Distribution DefaultCacheBehavior
DefaultCacheBehavior is a property of the DistributionConfig property
that describes the default cache behavior for an Amazon CloudFront distribution.
Syntax
JSON
{ "AllowedMethods" : [String, ...], "CachedMethods" : [String, ...], "Compress" :Boolean, "DefaultTTL" :Number, "FieldLevelEncryptionId" :String, "ForwardedValues" :ForwardedValues, "LambdaFunctionAssociations" : [ LambdaFunctionAssociation, ... ] "MaxTTL" :Number, "MinTTL" :Number, "SmoothStreaming" :Boolean, "TargetOriginId" :String, "TrustedSigners" : [String, ...], "ViewerProtocolPolicy" :String}
YAML
AllowedMethods: -StringCachedMethods: -StringCompress:BooleanDefaultTTL:NumberFieldLevelEncryptionId:String, ForwardedValues:ForwardedValuesLambdaFunctionAssociations: - LambdaFunctionAssociationMaxTTL:NumberMinTTL:NumberSmoothStreaming:BooleanTargetOriginId:StringTrustedSigners: -StringViewerProtocolPolicy :String
Properties
Note
For more information about the constraints and valid values of each property, see the DefaultCacheBehavior data type in the Amazon CloudFront API Reference.
AllowedMethods-
HTTP methods that CloudFront processes and forwards to your Amazon S3 bucket or your custom origin. In AWS CloudFormation templates, you can specify
["HEAD", "GET"],["GET", "HEAD", "OPTIONS"], or["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]. If you don't specify a value, AWS CloudFormation specifies["HEAD", "GET"].Required: No
Type: List of String values
CachedMethods-
HTTP methods for which CloudFront caches responses. In AWS CloudFormation templates, you can specify
["HEAD", "GET"]or["GET", "HEAD", "OPTIONS"]. If you don't specify a value, AWS CloudFormation specifies["HEAD", "GET"].Required: No
Type: List of String values
Compress-
Indicates whether CloudFront automatically compresses certain files for this cache behavior. For more information, see Serving Compressed Files in the Amazon CloudFront Developer Guide.
Required: No
Type: Boolean
DefaultTTL-
The default time in seconds that objects stay in CloudFront caches before CloudFront forwards another request to your custom origin to determine whether the object has been updated. This value applies only when your custom origin does not add HTTP headers, such as
Cache-Control max-age,Cache-Control s-maxage, andExpiresto objects.By default, AWS CloudFormation specifies
86400seconds (one day). If the value of theMinTTLproperty is greater than the default value, CloudFront uses the minimum Time To Live (TTL) value.Required: No
Type: Number
FieldLevelEncryptionId-
The value of ID for the field-level encryption configuration that you want CloudFront to use for encrypting specific fields of data for the default cache behavior in your distribution. The default is an empty string.
Required: No
Type: String
ForwardedValues-
Specifies how CloudFront handles query strings or cookies.
Required: Yes
Type: ForwardedValues type
LambdaFunctionAssociations-
Lambda function associations for the Amazon CloudFront distribution.
Required: No
Type: List of LambdaFunctionAssociation
Update requires: No interruption
MaxTTL-
The maximum time in seconds that objects stay in CloudFront caches before CloudFront forwards another request to your custom origin to determine whether the object has been updated. This value applies only when your custom origin adds HTTP headers, such as
Cache-Control max-age,Cache-Control s-maxage, andExpiresto objects.By default, AWS CloudFormation specifies
31536000seconds (one year). If the value of theMinTTLorDefaultTTLproperty is greater than the maximum value, CloudFront uses the default TTL value.Required: No
Type: Number
MinTTL-
The minimum amount of time that you want objects to stay in the cache before CloudFront queries your origin to see whether the object has been updated.
Required: No
Type: Number
SmoothStreaming-
Indicates whether to use the origin that is associated with this cache behavior to distribute media files in the Microsoft Smooth Streaming format.
Required: No
Type: Boolean
TargetOriginId-
The value of ID for the origin that CloudFront routes requests to when the default cache behavior is applied to a request.
Required: Yes
Type: String
TrustedSigners-
A list of AWS accounts that can create signed URLs in order to access private content.
Required: No
Type: List of String values
ViewerProtocolPolicy-
The protocol that users can use to access the files in the origin that you specified in the
TargetOriginIdproperty when the default cache behavior is applied to a request. For more information about the valid values, see theViewerProtocolPolicycontent for the DefaultCacheBehavior data type in the Amazon CloudFront API Reference.Required: Yes
Type: String
