Class CfnDistribution.CacheSettingsProperty
CacheSettings
is a property of the AWS::Lightsail::Distribution resource. It describes the cache settings of an Amazon Lightsail content delivery network (CDN) distribution.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Lightsail
Assembly: Amazon.CDK.AWS.Lightsail.dll
Syntax (csharp)
public class CacheSettingsProperty : Object, CfnDistribution.ICacheSettingsProperty
Syntax (vb)
Public Class CacheSettingsProperty
Inherits Object
Implements CfnDistribution.ICacheSettingsProperty
Remarks
These settings apply only to your distribution’s CacheBehaviors
that have a Behavior
of cache
. This includes the DefaultCacheBehavior
.
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.Lightsail;
var cacheSettingsProperty = new CacheSettingsProperty {
AllowedHttpMethods = "allowedHttpMethods",
CachedHttpMethods = "cachedHttpMethods",
DefaultTtl = 123,
ForwardedCookies = new CookieObjectProperty {
CookiesAllowList = new [] { "cookiesAllowList" },
Option = "option"
},
ForwardedHeaders = new HeaderObjectProperty {
HeadersAllowList = new [] { "headersAllowList" },
Option = "option"
},
ForwardedQueryStrings = new QueryStringObjectProperty {
Option = false,
QueryStringsAllowList = new [] { "queryStringsAllowList" }
},
MaximumTtl = 123,
MinimumTtl = 123
};
Synopsis
Constructors
CacheSettingsProperty() |
Properties
AllowedHttpMethods | The HTTP methods that are processed and forwarded to the distribution's origin. |
CachedHttpMethods | The HTTP method responses that are cached by your distribution. |
DefaultTtl | The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated. |
ForwardedCookies | An object that describes the cookies that are forwarded to the origin. |
ForwardedHeaders | An object that describes the headers that are forwarded to the origin. |
ForwardedQueryStrings | An object that describes the query strings that are forwarded to the origin. |
MaximumTtl | The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated. |
MinimumTtl | The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated. |
Constructors
CacheSettingsProperty()
public CacheSettingsProperty()
Properties
AllowedHttpMethods
The HTTP methods that are processed and forwarded to the distribution's origin.
public string AllowedHttpMethods { get; set; }
Property Value
System.String
Remarks
You can specify the following options:
If you specify GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
, you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin.
CachedHttpMethods
The HTTP method responses that are cached by your distribution.
public string CachedHttpMethods { get; set; }
Property Value
System.String
Remarks
You can specify the following options:
DefaultTtl
The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.
public Nullable<double> DefaultTtl { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age
, Cache-Control s-maxage
, and Expires
to objects.
ForwardedCookies
An object that describes the cookies that are forwarded to the origin.
public object ForwardedCookies { get; set; }
Property Value
System.Object
Remarks
Your content is cached based on the cookies that are forwarded.
ForwardedHeaders
An object that describes the headers that are forwarded to the origin.
public object ForwardedHeaders { get; set; }
Property Value
System.Object
Remarks
Your content is cached based on the headers that are forwarded.
ForwardedQueryStrings
An object that describes the query strings that are forwarded to the origin.
public object ForwardedQueryStrings { get; set; }
Property Value
System.Object
Remarks
Your content is cached based on the query strings that are forwarded.
MaximumTtl
The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.
public Nullable<double> MaximumTtl { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age
, Cache-Control s-maxage
, and Expires
to objects.
MinimumTtl
The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.
public Nullable<double> MinimumTtl { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
A value of 0
must be specified for minimumTTL
if the distribution is configured to forward all headers to the origin.