Class CacheCookieBehavior
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.CacheCookieBehavior
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:43.442Z")
@Stability(Stable)
public class CacheCookieBehavior
extends software.amazon.jsii.JsiiObject
Determines whether any cookies in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin.
Example:
// Creating a custom cache policy for a Distribution -- all parameters optional
S3Origin bucketOrigin;
CachePolicy myCachePolicy = CachePolicy.Builder.create(this, "myCachePolicy")
.cachePolicyName("MyPolicy")
.comment("A default policy")
.defaultTtl(Duration.days(2))
.minTtl(Duration.minutes(1))
.maxTtl(Duration.days(10))
.cookieBehavior(CacheCookieBehavior.all())
.headerBehavior(CacheHeaderBehavior.allowList("X-CustomHeader"))
.queryStringBehavior(CacheQueryStringBehavior.denyList("username"))
.enableAcceptEncodingGzip(true)
.enableAcceptEncodingBrotli(true)
.build();
Distribution.Builder.create(this, "myDistCustomPolicy")
.defaultBehavior(BehaviorOptions.builder()
.origin(bucketOrigin)
.cachePolicy(myCachePolicy)
.build())
.build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCacheCookieBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCacheCookieBehavior(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic CacheCookieBehaviorall()All cookies in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin.static CacheCookieBehaviorOnly the providedcookiesare included in the cache key and automatically included in requests that CloudFront sends to the origin.static CacheCookieBehaviorAll cookies except the providedcookiesare included in the cache key and automatically included in requests that CloudFront sends to the origin.The behavior of cookies: allow all, none, an allow list, or a deny list.The cookies to allow or deny, if the behavior is an allow or deny list.static CacheCookieBehaviornone()Cookies in viewer requests are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
CacheCookieBehavior
protected CacheCookieBehavior(software.amazon.jsii.JsiiObjectRef objRef) -
CacheCookieBehavior
protected CacheCookieBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
all
All cookies in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin. -
allowList
@Stability(Stable) @NotNull public static CacheCookieBehavior allowList(@NotNull @NotNull String... cookies) Only the providedcookiesare included in the cache key and automatically included in requests that CloudFront sends to the origin.- Parameters:
cookies- This parameter is required.
-
denyList
@Stability(Stable) @NotNull public static CacheCookieBehavior denyList(@NotNull @NotNull String... cookies) All cookies except the providedcookiesare included in the cache key and automatically included in requests that CloudFront sends to the origin.- Parameters:
cookies- This parameter is required.
-
none
Cookies in viewer requests are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin. -
getBehavior
The behavior of cookies: allow all, none, an allow list, or a deny list. -
getCookies
The cookies to allow or deny, if the behavior is an allow or deny list.
-