Class HttpRequestCacheConfiguration

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

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

The optional response-caching configuration shared by the HTTP-based function types (HTTP_REQUEST, AWS_SERVICE_REQUEST, and VAST_REQUEST). When you provide this configuration, MediaTailor caches the function's responses that have one of the following HTTP status codes: 200, 203, 204, 404, 405, 410, 414, and 501. For a cacheable response, MediaTailor caches it for the number of seconds given by the response's Cache-Control max-age directive, limited to the range between TtlMinimumSeconds and TtlMaximumSeconds. If the response has no Cache-Control max-age directive, MediaTailor caches it for TtlMinimumSeconds seconds. Cached HTTP responses are scoped per playback configuration, not per function.

See Also:
  • Method Details

    • ttlMinimumSeconds

      public final Integer ttlMinimumSeconds()

      The lower bound, in seconds, on how long MediaTailor caches a response. MediaTailor also uses this value as the cache duration when a response has no Cache-Control max-age directive.

      Returns:
      The lower bound, in seconds, on how long MediaTailor caches a response. MediaTailor also uses this value as the cache duration when a response has no Cache-Control max-age directive.
    • ttlMaximumSeconds

      public final Integer ttlMaximumSeconds()

      The upper bound, in seconds, on how long MediaTailor caches a response. This value must be greater than or equal to TtlMinimumSeconds.

      Returns:
      The upper bound, in seconds, on how long MediaTailor caches a response. This value must be greater than or equal to TtlMinimumSeconds.
    • key

      public final String key()

      A JSONata expression that MediaTailor evaluates to a custom cache key. By default, the cache key is a hash of the HTTP URL, the request body, and the HTTP method; request headers are not included. You can specify a custom cache key expression to vary caching by request headers and more. The evaluated key must be smaller than 1 KB; otherwise the HTTP function will fail.

      Returns:
      A JSONata expression that MediaTailor evaluates to a custom cache key. By default, the cache key is a hash of the HTTP URL, the request body, and the HTTP method; request headers are not included. You can specify a custom cache key expression to vary caching by request headers and more. The evaluated key must be smaller than 1 KB; otherwise the HTTP function will fail.
    • 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<HttpRequestCacheConfiguration.Builder,HttpRequestCacheConfiguration>
      Returns:
      a builder for type T
    • builder

      public static HttpRequestCacheConfiguration.Builder builder()
    • serializableBuilderClass

      public static Class<? extends HttpRequestCacheConfiguration.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.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.