Interface CfnDistribution.CacheSettingsProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnDistribution.CacheSettingsProperty.Jsii$Proxy
Enclosing class:
CfnDistribution

@Stability(Stable) public static interface CfnDistribution.CacheSettingsProperty extends software.amazon.jsii.JsiiSerializable
CacheSettings is a property of the AWS::Lightsail::Distribution resource. It describes the cache settings of an Amazon Lightsail content delivery network (CDN) distribution.

These settings apply only to your distribution’s CacheBehaviors that have a Behavior of cache . This includes the DefaultCacheBehavior .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lightsail.*;
 CacheSettingsProperty cacheSettingsProperty = CacheSettingsProperty.builder()
         .allowedHttpMethods("allowedHttpMethods")
         .cachedHttpMethods("cachedHttpMethods")
         .defaultTtl(123)
         .forwardedCookies(CookieObjectProperty.builder()
                 .cookiesAllowList(List.of("cookiesAllowList"))
                 .option("option")
                 .build())
         .forwardedHeaders(HeaderObjectProperty.builder()
                 .headersAllowList(List.of("headersAllowList"))
                 .option("option")
                 .build())
         .forwardedQueryStrings(QueryStringObjectProperty.builder()
                 .option(false)
                 .queryStringsAllowList(List.of("queryStringsAllowList"))
                 .build())
         .maximumTtl(123)
         .minimumTtl(123)
         .build();
 
  • Method Details

    • getAllowedHttpMethods

      @Stability(Stable) @Nullable default String getAllowedHttpMethods()
      The HTTP methods that are processed and forwarded to the distribution's origin.

      You can specify the following options:

      • GET,HEAD - The distribution forwards the GET and HEAD methods.
      • GET,HEAD,OPTIONS - The distribution forwards the GET , HEAD , and OPTIONS methods.
      • GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards the GET , HEAD , OPTIONS , PUT , PATCH , POST , and DELETE methods.

      If you specify GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE , you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin.

    • getCachedHttpMethods

      @Stability(Stable) @Nullable default String getCachedHttpMethods()
      The HTTP method responses that are cached by your distribution.

      You can specify the following options:

      • GET,HEAD - The distribution caches responses to the GET and HEAD methods.
      • GET,HEAD,OPTIONS - The distribution caches responses to the GET , HEAD , and OPTIONS methods.
    • getDefaultTtl

      @Stability(Stable) @Nullable default Number getDefaultTtl()
      The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.

      The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects.

    • getForwardedCookies

      @Stability(Stable) @Nullable default Object getForwardedCookies()
      An object that describes the cookies that are forwarded to the origin.

      Your content is cached based on the cookies that are forwarded.

    • getForwardedHeaders

      @Stability(Stable) @Nullable default Object getForwardedHeaders()
      An object that describes the headers that are forwarded to the origin.

      Your content is cached based on the headers that are forwarded.

    • getForwardedQueryStrings

      @Stability(Stable) @Nullable default Object getForwardedQueryStrings()
      An object that describes the query strings that are forwarded to the origin.

      Your content is cached based on the query strings that are forwarded.

    • getMaximumTtl

      @Stability(Stable) @Nullable default Number getMaximumTtl()
      The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

      The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects.

    • getMinimumTtl

      @Stability(Stable) @Nullable default Number getMinimumTtl()
      The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.

      A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin.

    • builder

      @Stability(Stable) static CfnDistribution.CacheSettingsProperty.Builder builder()
      Returns:
      a CfnDistribution.CacheSettingsProperty.Builder of CfnDistribution.CacheSettingsProperty