aws-cdk-lib.aws_lightsail.CfnDistribution.CacheSettingsProperty

interface CacheSettingsProperty

LanguageType name
.NETAmazon.CDK.AWS.Lightsail.CfnDistribution.CacheSettingsProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslightsail#CfnDistribution_CacheSettingsProperty
Javasoftware.amazon.awscdk.services.lightsail.CfnDistribution.CacheSettingsProperty
Pythonaws_cdk.aws_lightsail.CfnDistribution.CacheSettingsProperty
TypeScript aws-cdk-lib » aws_lightsail » 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.

These settings apply only to your distribution’s CacheBehaviors that have a Behavior of cache . This includes the DefaultCacheBehavior .

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const cacheSettingsProperty: lightsail.CfnDistribution.CacheSettingsProperty = {
  allowedHttpMethods: 'allowedHttpMethods',
  cachedHttpMethods: 'cachedHttpMethods',
  defaultTtl: 123,
  forwardedCookies: {
    cookiesAllowList: ['cookiesAllowList'],
    option: 'option',
  },
  forwardedHeaders: {
    headersAllowList: ['headersAllowList'],
    option: 'option',
  },
  forwardedQueryStrings: {
    option: false,
    queryStringsAllowList: ['queryStringsAllowList'],
  },
  maximumTtl: 123,
  minimumTtl: 123,
};

Properties

NameTypeDescription
allowedHttpMethods?stringThe HTTP methods that are processed and forwarded to the distribution's origin.
cachedHttpMethods?stringThe HTTP method responses that are cached by your distribution.
defaultTtl?numberThe 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?IResolvable | CookieObjectPropertyAn object that describes the cookies that are forwarded to the origin.
forwardedHeaders?IResolvable | HeaderObjectPropertyAn object that describes the headers that are forwarded to the origin.
forwardedQueryStrings?IResolvable | QueryStringObjectPropertyAn object that describes the query strings that are forwarded to the origin.
maximumTtl?numberThe 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?numberThe 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.

allowedHttpMethods?

Type: string (optional)

The HTTP methods that are processed and forwarded to the distribution's origin.

You can specify the following options:

  • GET,HEAD - The distribution forwards the GET and HEAD methods.
  • GET,HEAD,OPTIONS - The distribution forwards the GET , HEAD , and OPTIONS methods.
  • GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards the GET , HEAD , OPTIONS , PUT , PATCH , POST , and DELETE methods.

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?

Type: string (optional)

The HTTP method responses that are cached by your distribution.

You can specify the following options:

  • GET,HEAD - The distribution caches responses to the GET and HEAD methods.
  • GET,HEAD,OPTIONS - The distribution caches responses to the GET , HEAD , and OPTIONS methods.

defaultTtl?

Type: number (optional)

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.

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?

Type: IResolvable | CookieObjectProperty (optional)

An object that describes the cookies that are forwarded to the origin.

Your content is cached based on the cookies that are forwarded.


forwardedHeaders?

Type: IResolvable | HeaderObjectProperty (optional)

An object that describes the headers that are forwarded to the origin.

Your content is cached based on the headers that are forwarded.


forwardedQueryStrings?

Type: IResolvable | QueryStringObjectProperty (optional)

An object that describes the query strings that are forwarded to the origin.

Your content is cached based on the query strings that are forwarded.


maximumTtl?

Type: number (optional)

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.

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?

Type: number (optional)

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.

A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin.