Interface CfnDistribution.CacheSettingsProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnDistribution.CacheSettingsProperty.Jsii$Proxy
- Enclosing class:
CfnDistribution
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 software.amazon.awscdk.services.lightsail.*;
CacheSettingsProperty cacheSettingsProperty = CacheSettingsProperty.builder()
.allowedHttpMethods("allowedHttpMethods")
.cachedHttpMethods("cachedHttpMethods")
.defaultTtl(123)
.forwardedCookies(CookieObjectProperty.builder()
.cookiesAllowList(List.of("cookiesAllowList"))
.option("option")
.build())
.forwardedHeaders(HeaderObjectProperty.builder()
.headersAllowList(List.of("headersAllowList"))
.option("option")
.build())
.forwardedQueryStrings(QueryStringObjectProperty.builder()
.option(false)
.queryStringsAllowList(List.of("queryStringsAllowList"))
.build())
.maximumTtl(123)
.minimumTtl(123)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnDistribution.CacheSettingsPropertystatic final classAn implementation forCfnDistribution.CacheSettingsProperty -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default StringThe HTTP methods that are processed and forwarded to the distribution's origin.default StringThe HTTP method responses that are cached by your distribution.default 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.default ObjectAn object that describes the cookies that are forwarded to the origin.default ObjectAn object that describes the headers that are forwarded to the origin.default ObjectAn object that describes the query strings that are forwarded to the origin.default 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.default 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.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAllowedHttpMethods
The HTTP methods that are processed and forwarded to the distribution's origin.You can specify the following options:
GET,HEAD- The distribution forwards theGETandHEADmethods.GET,HEAD,OPTIONS- The distribution forwards theGET,HEAD, andOPTIONSmethods.GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE- The distribution forwards theGET,HEAD,OPTIONS,PUT,PATCH,POST, andDELETEmethods.
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.- See Also:
-
getCachedHttpMethods
The HTTP method responses that are cached by your distribution.You can specify the following options:
GET,HEAD- The distribution caches responses to theGETandHEADmethods.GET,HEAD,OPTIONS- The distribution caches responses to theGET,HEAD, andOPTIONSmethods.
- See Also:
-
getDefaultTtl
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, andExpiresto objects.- See Also:
-
getForwardedCookies
An object that describes the cookies that are forwarded to the origin.Your content is cached based on the cookies that are forwarded.
Returns union: either
IResolvableorCfnDistribution.CookieObjectProperty- See Also:
-
getForwardedHeaders
An object that describes the headers that are forwarded to the origin.Your content is cached based on the headers that are forwarded.
Returns union: either
IResolvableorCfnDistribution.HeaderObjectProperty- See Also:
-
getForwardedQueryStrings
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.
Returns union: either
IResolvableorCfnDistribution.QueryStringObjectProperty- See Also:
-
getMaximumTtl
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, andExpiresto objects.- See Also:
-
getMinimumTtl
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
0must be specified forminimumTTLif the distribution is configured to forward all headers to the origin.- See Also:
-
builder
-