Class CacheSettings
- All Implemented Interfaces:
Serializable
,SdkPojo
,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:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
The HTTP methods that are processed and forwarded to the distribution's origin.static CacheSettings.Builder
builder()
final String
The HTTP method responses that are cached by your distribution.final Long
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.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final CookieObject
An object that describes the cookies that are forwarded to the origin.final HeaderObject
An object that describes the headers that are forwarded to the origin.final QueryStringObject
An object that describes the query strings that are forwarded to the origin.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final int
hashCode()
final Long
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.final Long
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.static Class
<? extends CacheSettings.Builder> Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
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
, andExpires
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
, andExpires
to objects.
-
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 forminimumTTL
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 forminimumTTL
if the distribution is configured to forward all headers to the origin.
-
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
, andExpires
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
, andExpires
to objects.
-
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 theGET
andHEAD
methods. -
GET,HEAD,OPTIONS
- The distribution forwards theGET
,HEAD
, andOPTIONS
methods. -
GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
- The distribution forwards theGET
,HEAD
,OPTIONS
,PUT
,PATCH
,POST
, andDELETE
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 theGET
andHEAD
methods. -
GET,HEAD,OPTIONS
- The distribution forwards theGET
,HEAD
, andOPTIONS
methods. -
GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
- The distribution forwards theGET
,HEAD
,OPTIONS
,PUT
,PATCH
,POST
, andDELETE
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
The HTTP method responses that are cached by your distribution.
You can specify the following options:
-
GET,HEAD
- The distribution caches responses to theGET
andHEAD
methods. -
GET,HEAD,OPTIONS
- The distribution caches responses to theGET
,HEAD
, andOPTIONS
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 theGET
andHEAD
methods. -
GET,HEAD,OPTIONS
- The distribution caches responses to theGET
,HEAD
, andOPTIONS
methods.
-
-
-
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
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
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
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 interfaceToCopyableBuilder<CacheSettings.Builder,
CacheSettings> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
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 anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
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. -
getValueForField
-
sdkFields
-