@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.053Z") @Stability(value=Stable) public class CacheCookieBehavior extends software.amazon.jsii.JsiiObject
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();
| Modifier | Constructor and Description |
|---|---|
protected |
CacheCookieBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CacheCookieBehavior(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static CacheCookieBehavior |
all()
All cookies in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin.
|
static CacheCookieBehavior |
allowList(String... cookies)
Only the provided `cookies` are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
static CacheCookieBehavior |
denyList(String... cookies)
All cookies except the provided `cookies` are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
String |
getBehavior()
The behavior of cookies: allow all, none, an allow list, or a deny list.
|
List<String> |
getCookies()
The cookies to allow or deny, if the behavior is an allow or deny list.
|
static CacheCookieBehavior |
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.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected CacheCookieBehavior(software.amazon.jsii.JsiiObjectRef objRef)
protected CacheCookieBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) @NotNull public static CacheCookieBehavior all()
@Stability(value=Stable) @NotNull public static CacheCookieBehavior allowList(@NotNull String... cookies)
cookies - This parameter is required.@Stability(value=Stable) @NotNull public static CacheCookieBehavior denyList(@NotNull String... cookies)
cookies - This parameter is required.@Stability(value=Stable) @NotNull public static CacheCookieBehavior none()
@Stability(value=Stable) @NotNull public String getBehavior()
Copyright © 2022. All rights reserved.