Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

CloudFront DefaultCacheBehavior

DefaultCacheBehavior is a property of the DistributionConfig property that describes the default cache behavior for an Amazon CloudFront distribution.

Syntax

{
  "AllowedMethods" : [ String, ... ],
  "CachedMethods" : [ String, ... ],
  "DefaultTTL" : Number,
  "ForwardedValues" : ForwardedValues,
  "MaxTTL" : Number,
  "MinTTL" : Number,
  "SmoothStreaming" : Boolean,
  "TargetOriginId" : String,
  "TrustedSigners" : [ String, ... ],
  "ViewerProtocolPolicy" : String
}

Properties

Note

For more information about the constraints and valid values of each property, see the elements table in the DistributionConfig Complex Type topic 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 strings

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 strings

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, and Expires to objects.

By default, AWS CloudFormation specifies 86400 seconds (one day). If the value of the MinTTL property is greater than the default value, CloudFront uses the minimum Time To Live (TTL) value.

Required: No

Type: Number

ForwardedValues

Specifies how CloudFront handles query strings or cookies.

Required: Yes

Type: ForwardedValues type

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 does not add HTTP headers, such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects.

By default, AWS CloudFormation specifies 31536000 seconds (one year). If the value of the MinTTL or DefaultTTL property 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: String

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 strings

ViewerProtocolPolicy

The protocol that users can use to access the files in the origin that you specified in the TargetOriginId property when the default cache behavior is applied to a request. For valid values, see the ViewerProtocolPolicy element of the DistributionConfig Complex Type in the Amazon CloudFront API Reference.

Required: Yes

Type: String