@Generated(value="jsii-pacmak/1.70.0 (build 03c2f6f)", date="2022-11-01T13:16:43.741Z") @Stability(value=Experimental) public class CacheHeaderBehavior 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 |
CacheHeaderBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CacheHeaderBehavior(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static CacheHeaderBehavior |
allowList(String... headers)
(experimental) Listed headers are included in the cache key and are automatically included in requests that CloudFront sends to the origin.
|
String |
getBehavior()
(experimental) If no headers will be passed, or an allow list of headers.
|
List<String> |
getHeaders()
(experimental) The headers for the allow/deny list, if applicable.
|
static CacheHeaderBehavior |
none()
(experimental) HTTP headers 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 CacheHeaderBehavior(software.amazon.jsii.JsiiObjectRef objRef)
protected CacheHeaderBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) @NotNull public static CacheHeaderBehavior allowList(@NotNull String... headers)
headers - This parameter is required.@Stability(value=Experimental) @NotNull public static CacheHeaderBehavior none()
@Stability(value=Experimental) @NotNull public String getBehavior()
Copyright © 2022. All rights reserved.