Class CacheQueryStringBehavior

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.CacheQueryStringBehavior
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-04-10T22:22:24.678Z") @Stability(Stable) public class CacheQueryStringBehavior extends software.amazon.jsii.JsiiObject
Determines whether any URL query strings 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

    Constructors
    Modifier
    Constructor
    Description
    protected
    CacheQueryStringBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    CacheQueryStringBehavior(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    allowList(@NotNull String... queryStrings)
    Only the provided queryStrings are included in the cache key and automatically included in requests that CloudFront sends to the origin.
    denyList(@NotNull 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.
    The behavior of query strings -- allow all, none, only an allow list, or a deny list.
    The query strings to allow or deny, if the behavior is an allow or deny list.
    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.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • CacheQueryStringBehavior

      protected CacheQueryStringBehavior(software.amazon.jsii.JsiiObjectRef objRef)
    • CacheQueryStringBehavior

      protected CacheQueryStringBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • all

      @Stability(Stable) @NotNull public 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.
    • allowList

      @Stability(Stable) @NotNull public static CacheQueryStringBehavior allowList(@NotNull @NotNull String... queryStrings)
      Only the provided queryStrings are included in the cache key and automatically included in requests that CloudFront sends to the origin.

      Parameters:
      queryStrings - This parameter is required.
    • denyList

      @Stability(Stable) @NotNull public static CacheQueryStringBehavior denyList(@NotNull @NotNull 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.

      Parameters:
      queryStrings - This parameter is required.
    • none

      @Stability(Stable) @NotNull public 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.
    • getBehavior

      @Stability(Stable) @NotNull public String getBehavior()
      The behavior of query strings -- allow all, none, only an allow list, or a deny list.
    • getQueryStrings

      @Stability(Stable) @Nullable public List<String> getQueryStrings()
      The query strings to allow or deny, if the behavior is an allow or deny list.