API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see

We welcome your feedback on this new version of the documentation. Send your comments to


import ""

type CacheBehaviors struct { Items []*CacheBehavior `locationNameList:"CacheBehavior" type:"list"` Quantity *int64 `type:"integer" required:"true"` }

A complex type that contains zero or more CacheBehavior elements.


A complex type that describes how CloudFront processes requests.

You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to distribute objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin is never used.

For the current limit on the number of cache behaviors that you can add to a distribution, see Amazon CloudFront Limits ( in the AWS General Reference.

If you don't want to specify any cache behaviors, include only an empty CacheBehaviors element. Don't include an empty CacheBehavior element, or CloudFront returns a MalformedXML error.

To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty CacheBehaviors element.

To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution.

For more information about cache behaviors, see Cache Behaviors ( in the Amazon CloudFront Developer Guide.


Type: *int64

The number of cache behaviors for this distribution.

Quantity is a required field



func (s CacheBehaviors) GoString() string

GoString returns the string representation


func (s *CacheBehaviors) SetItems(v []*CacheBehavior) *CacheBehaviors

SetItems sets the Items field's value.


func (s *CacheBehaviors) SetQuantity(v int64) *CacheBehaviors

SetQuantity sets the Quantity field's value.


func (s CacheBehaviors) String() string

String returns the string representation


func (s *CacheBehaviors) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: