Show / Hide Table of Contents

Class CfnCachePolicy.CachePolicyConfigProperty

A cache policy configuration.

Inheritance
object
CfnCachePolicy.CachePolicyConfigProperty
Implements
CfnCachePolicy.ICachePolicyConfigProperty
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnCachePolicy.CachePolicyConfigProperty : CfnCachePolicy.ICachePolicyConfigProperty
Syntax (vb)
Public Class CfnCachePolicy.CachePolicyConfigProperty Implements CfnCachePolicy.ICachePolicyConfigProperty
Remarks

This configuration determines the following:

    If your minimum TTL is greater than 0, CloudFront will cache content for at least the duration specified in the cache policy's minimum TTL, even if the <code>Cache-Control: no-cache</code> , <code>no-store</code> , or <code>private</code> directives are present in the origin headers.
    

    The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find a valid object in its cache that matches the request's cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy .

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html

    ExampleMetadata: fixture=_generated

    Examples
    // The code below shows an example of how to instantiate this type.
                 // The values are placeholders you should change.
                 using Amazon.CDK.AWS.CloudFront;
    
                 var cachePolicyConfigProperty = new CachePolicyConfigProperty {
                     DefaultTtl = 123,
                     MaxTtl = 123,
                     MinTtl = 123,
                     Name = "name",
                     ParametersInCacheKeyAndForwardedToOrigin = new ParametersInCacheKeyAndForwardedToOriginProperty {
                         CookiesConfig = new CookiesConfigProperty {
                             CookieBehavior = "cookieBehavior",
    
                             // the properties below are optional
                             Cookies = new [] { "cookies" }
                         },
                         EnableAcceptEncodingGzip = false,
                         HeadersConfig = new HeadersConfigProperty {
                             HeaderBehavior = "headerBehavior",
    
                             // the properties below are optional
                             Headers = new [] { "headers" }
                         },
                         QueryStringsConfig = new QueryStringsConfigProperty {
                             QueryStringBehavior = "queryStringBehavior",
    
                             // the properties below are optional
                             QueryStrings = new [] { "queryStrings" }
                         },
    
                         // the properties below are optional
                         EnableAcceptEncodingBrotli = false
                     },
    
                     // the properties below are optional
                     Comment = "comment"
                 };

    Synopsis

    Constructors

    CachePolicyConfigProperty()

    A cache policy configuration.

    Properties

    Comment

    A comment to describe the cache policy.

    DefaultTtl

    The default amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

    MaxTtl

    The maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

    MinTtl

    The minimum amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

    Name

    A unique name to identify the cache policy.

    ParametersInCacheKeyAndForwardedToOrigin

    The HTTP headers, cookies, and URL query strings to include in the cache key.

    Constructors

    CachePolicyConfigProperty()

    A cache policy configuration.

    public CachePolicyConfigProperty()
    Remarks

    This configuration determines the following:

      If your minimum TTL is greater than 0, CloudFront will cache content for at least the duration specified in the cache policy's minimum TTL, even if the <code>Cache-Control: no-cache</code> , <code>no-store</code> , or <code>private</code> directives are present in the origin headers.
      

      The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find a valid object in its cache that matches the request's cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy .

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html

      ExampleMetadata: fixture=_generated

      Examples
      // The code below shows an example of how to instantiate this type.
                   // The values are placeholders you should change.
                   using Amazon.CDK.AWS.CloudFront;
      
                   var cachePolicyConfigProperty = new CachePolicyConfigProperty {
                       DefaultTtl = 123,
                       MaxTtl = 123,
                       MinTtl = 123,
                       Name = "name",
                       ParametersInCacheKeyAndForwardedToOrigin = new ParametersInCacheKeyAndForwardedToOriginProperty {
                           CookiesConfig = new CookiesConfigProperty {
                               CookieBehavior = "cookieBehavior",
      
                               // the properties below are optional
                               Cookies = new [] { "cookies" }
                           },
                           EnableAcceptEncodingGzip = false,
                           HeadersConfig = new HeadersConfigProperty {
                               HeaderBehavior = "headerBehavior",
      
                               // the properties below are optional
                               Headers = new [] { "headers" }
                           },
                           QueryStringsConfig = new QueryStringsConfigProperty {
                               QueryStringBehavior = "queryStringBehavior",
      
                               // the properties below are optional
                               QueryStrings = new [] { "queryStrings" }
                           },
      
                           // the properties below are optional
                           EnableAcceptEncodingBrotli = false
                       },
      
                       // the properties below are optional
                       Comment = "comment"
                   };

      Properties

      Comment

      A comment to describe the cache policy.

      public string? Comment { get; set; }
      Property Value

      string

      Remarks

      The comment cannot be longer than 128 characters.

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-comment

      DefaultTtl

      The default amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

      public double DefaultTtl { get; set; }
      Property Value

      double

      Remarks

      CloudFront uses this value as the object's time to live (TTL) only when the origin does not send Cache-Control or Expires headers with the object. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .

      The default value for this field is 86400 seconds (one day). If the value of MinTTL is more than 86400 seconds, then the default value for this field is the same as the value of MinTTL .

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-defaultttl

      MaxTtl

      The maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

      public double MaxTtl { get; set; }
      Property Value

      double

      Remarks

      CloudFront uses this value only when the origin sends Cache-Control or Expires headers with the object. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .

      The default value for this field is 31536000 seconds (one year). If the value of MinTTL or DefaultTTL is more than 31536000 seconds, then the default value for this field is the same as the value of DefaultTTL .

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-maxttl

      MinTtl

      The minimum amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.

      public double MinTtl { get; set; }
      Property Value

      double

      Remarks

      For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-minttl

      Name

      A unique name to identify the cache policy.

      public string Name { get; set; }
      Property Value

      string

      Remarks

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-name

      ParametersInCacheKeyAndForwardedToOrigin

      The HTTP headers, cookies, and URL query strings to include in the cache key.

      public object ParametersInCacheKeyAndForwardedToOrigin { get; set; }
      Property Value

      object

      Remarks

      The values included in the cache key are also included in requests that CloudFront sends to the origin.

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-parametersincachekeyandforwardedtoorigin

      Type union: either IResolvable or CfnCachePolicy.IParametersInCacheKeyAndForwardedToOriginProperty

      Implements

      CfnCachePolicy.ICachePolicyConfigProperty
      Back to top Generated by DocFX