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
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal StringThe HTTP methods that are processed and forwarded to the distribution's origin.static CacheSettings.Builderbuilder()final StringThe HTTP method responses that are cached by your distribution.final LongThe 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 booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final CookieObjectAn object that describes the cookies that are forwarded to the origin.final HeaderObjectAn object that describes the headers that are forwarded to the origin.final QueryStringObjectAn object that describes the query strings that are forwarded to the origin.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) final inthashCode()final LongThe 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 LongThe 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 StringtoString()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, andExpiresto 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, andExpiresto 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
0must be specified forminimumTTLif 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
0must be specified forminimumTTLif 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, andExpiresto 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, andExpiresto 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 theGETandHEADmethods. -
GET,HEAD,OPTIONS- The distribution forwards theGET,HEAD, andOPTIONSmethods. -
GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE- The distribution forwards theGET,HEAD,OPTIONS,PUT,PATCH,POST, andDELETEmethods.
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 theGETandHEADmethods. -
GET,HEAD,OPTIONS- The distribution forwards theGET,HEAD, andOPTIONSmethods. -
GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE- The distribution forwards theGET,HEAD,OPTIONS,PUT,PATCH,POST, andDELETEmethods.
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 theGETandHEADmethods. -
GET,HEAD,OPTIONS- The distribution caches responses to theGET,HEAD, andOPTIONSmethods.
- Returns:
- The HTTP method responses that are cached by your distribution.
You can specify the following options:
-
GET,HEAD- The distribution caches responses to theGETandHEADmethods. -
GET,HEAD,OPTIONS- The distribution caches responses to theGET,HEAD, andOPTIONSmethods.
-
-
-
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:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<CacheSettings.Builder,CacheSettings> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin 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
-
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-