@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-11T17:58:48.620Z") @Stability(value=Stable) public class CacheQueryStringBehavior 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 |
CacheQueryStringBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CacheQueryStringBehavior(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static CacheQueryStringBehavior |
all()
All query strings in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin.
|
static CacheQueryStringBehavior |
allowList(String... queryStrings)
Only the provided `queryStrings` are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
static CacheQueryStringBehavior |
denyList(String... queryStrings)
All query strings except the provided `queryStrings` are included in the cache key and automatically included in requests that CloudFront sends to the origin.
|
String |
getBehavior()
The behavior of query strings -- allow all, none, only an allow list, or a deny list.
|
List<String> |
getQueryStrings()
The query strings to allow or deny, if the behavior is an allow or deny list.
|
static CacheQueryStringBehavior |
none()
Query strings 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 CacheQueryStringBehavior(software.amazon.jsii.JsiiObjectRef objRef)
protected CacheQueryStringBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) @NotNull public static CacheQueryStringBehavior all()
@Stability(value=Stable) @NotNull public static CacheQueryStringBehavior allowList(@NotNull String... queryStrings)
queryStrings - This parameter is required.@Stability(value=Stable) @NotNull public static CacheQueryStringBehavior denyList(@NotNull String... queryStrings)
queryStrings - This parameter is required.@Stability(value=Stable) @NotNull public static CacheQueryStringBehavior none()
@Stability(value=Stable) @NotNull public String getBehavior()
Copyright © 2022. All rights reserved.