AWS CloudFormation
User Guide (API Version 2010-05-15)
Did this page help you?  Yes | No |  Tell us about it...
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.

CloudFront DistributionConfig CacheBehavior

CacheBehavior is a property of the DistributionConfig property that describes the Amazon CloudFront cache behavior when the requested URL matches a pattern.

Syntax

{
   "AllowedMethods" : [ String ],
   "ForwardedValues" : ForwardedValues,
   "MinTTL" : String,
   "PathPattern" : String,
   "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. You can specify ["HEAD", "GET"] or ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"].

Required: No

Type: A list of strings

ForwardedValues

Specifies how CloudFront handles query strings or cookies.

Required: Yes

Type: ForwardedValues type

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

PathPattern

The pattern for which this cache behavior applies to. For example, you can specify images/*.jpg.

When CloudFront receives an end-user request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the stack specification for the distribution.

Required: Yes

Type: String

SmoothStreaming

Indicates whether to distribute media files in the Microsoft Smooth Streaming format by using the origin that is associated with this cache behavior. If you specify true, you can still use this cache behavior to distribute other content if the content matches the PathPattern value.

Required: No

Type: Boolean

TargetOriginId

The ID value of the origin to which you want CloudFront to route requests when a request matches the value of the PathPattern property.

Required: Yes

Type: String

TrustedSigners

A list of AWS accounts that can create signed URLs in order to access private content.

Required: No

Type: A 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 a request matches the value of the PathPattern property.

Required: Yes

Type: String

Template Examples

To view AWS::CloudFront::Distribution snippets, see Amazon CloudFront Template Snippets.