Class: Aws::CloudFront::Types::Headers

Inherits:
Struct
  • Object
show all
Includes:
Structure
Defined in:
lib/aws-sdk-cloudfront/types.rb

Overview

Note:

When making an API call, you may pass Headers data as a hash:

{
  quantity: 1, # required
  items: ["string"],
}

A complex type that specifies the headers that you want CloudFront to forward to the origin for this cache behavior.

For the headers that you specify, CloudFront also caches separate versions of a specified object based on the header values in viewer requests. For example, suppose viewer requests for ‘logo.jpg` contain a custom `Product` header that has a value of either `Acme` or `Apex`, and you configure CloudFront to cache your content based on values in the `Product` header. CloudFront forwards the `Product` header to the origin and caches the response from the origin once for each header value. For more information about caching based on header values, see

How CloudFront Forwards and Caches Headers][1

in the *Amazon

CloudFront Developer Guide*.

[1]: docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html

Instance Attribute Summary collapse

Instance Attribute Details

#itemsArray<String>

A complex type that contains one ‘Name` element for each header that you want CloudFront to forward to the origin and to vary on for this cache behavior. If `Quantity` is `0`, omit `Items`.

Returns:

  • (Array<String>)


3553
3554
3555
3556
3557
# File 'lib/aws-sdk-cloudfront/types.rb', line 3553

class Headers < Struct.new(
  :quantity,
  :items)
  include Aws::Structure
end

#quantityInteger

The number of different headers that you want CloudFront to forward to the origin for this cache behavior. You can configure each cache behavior in a web distribution to do one of the following:

  • **Forward all headers to your origin**: Specify ‘1` for `Quantity` and `*` for `Name`.

    If you configure CloudFront to forward all headers to your origin, CloudFront doesn’t cache the objects associated with this cache behavior. Instead, it sends every request to the origin.

  • *Forward a whitelist of headers you specify*: Specify the number of headers that you want to forward, and specify the header names in ‘Name` elements. CloudFront caches your objects based on the values in all of the specified headers. CloudFront also forwards the headers that it forwards by default, but it caches your objects based only on the headers that you specify.

  • **Forward only the default headers**: Specify ‘0` for `Quantity` and omit `Items`. In this configuration, CloudFront doesn’t cache based on the values in the request headers.

Returns:

  • (Integer)


3553
3554
3555
3556
3557
# File 'lib/aws-sdk-cloudfront/types.rb', line 3553

class Headers < Struct.new(
  :quantity,
  :items)
  include Aws::Structure
end