interface CacheSettingsProperty
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lightsail.CfnDistribution.CacheSettingsProperty |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslightsail#CfnDistribution_CacheSettingsProperty |
Java | software.amazon.awscdk.services.lightsail.CfnDistribution.CacheSettingsProperty |
Python | aws_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
Name | Type | Description |
---|---|---|
allowed | string | The HTTP methods that are processed and forwarded to the distribution's origin. |
cached | string | The HTTP method responses that are cached by your distribution. |
default | number | 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. |
forwarded | IResolvable | Cookie | An object that describes the cookies that are forwarded to the origin. |
forwarded | IResolvable | Header | An object that describes the headers that are forwarded to the origin. |
forwarded | IResolvable | Query | An object that describes the query strings that are forwarded to the origin. |
maximum | number | 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. |
minimum | number | 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. |
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 theGET
andHEAD
methods.GET,HEAD,OPTIONS
- The distribution forwards theGET
,HEAD
, andOPTIONS
methods.GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
- The distribution forwards theGET
,HEAD
,OPTIONS
,PUT
,PATCH
,POST
, andDELETE
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 theGET
andHEAD
methods.GET,HEAD,OPTIONS
- The distribution caches responses to theGET
,HEAD
, andOPTIONS
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
, andExpires
to objects.
forwardedCookies?
Type:
IResolvable
|
Cookie
(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
|
Header
(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
|
Query
(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.