java.lang.Object
software.amazon.awssdk.services.lightsail.model.CacheSettings
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<CacheSettings.Builder,CacheSettings>

@Generated("software.amazon.awssdk:codegen") public final class CacheSettings extends Object implements SdkPojo, Serializable, ToCopyableBuilder<CacheSettings.Builder,CacheSettings>

Describes the cache settings of an Amazon Lightsail content delivery network (CDN) distribution.

These settings apply only to your distribution's cacheBehaviors (including the defaultCacheBehavior) that have a behavior of cache.

See Also:
  • Method Details

    • defaultTTL

      public final Long defaultTTL()

      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.

      Returns:
      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.

    • minimumTTL

      public final Long minimumTTL()

      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.

      Returns:
      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.

    • maximumTTL

      public final Long maximumTTL()

      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.

      Returns:
      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.

    • allowedHTTPMethods

      public final String allowedHTTPMethods()

      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 the third option, 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.

      Returns:
      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 the third option, 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.

    • cachedHTTPMethods

      public final String cachedHTTPMethods()

      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.

      Returns:
      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.

    • forwardedCookies

      public final CookieObject forwardedCookies()

      An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.

      Returns:
      An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.
    • forwardedHeaders

      public final HeaderObject forwardedHeaders()

      An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.

      Returns:
      An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.
    • forwardedQueryStrings

      public final QueryStringObject forwardedQueryStrings()

      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.

      Returns:
      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.
    • toBuilder

      public CacheSettings.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<CacheSettings.Builder,CacheSettings>
      Returns:
      a builder for type T
    • builder

      public static CacheSettings.Builder builder()
    • serializableBuilderClass

      public static Class<? extends CacheSettings.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.