logo
pub struct CacheSettings {
    pub allowed_http_methods: Option<String>,
    pub cached_http_methods: Option<String>,
    pub default_ttl: Option<i64>,
    pub forwarded_cookies: Option<CookieObject>,
    pub forwarded_headers: Option<HeaderObject>,
    pub forwarded_query_strings: Option<QueryStringObject>,
    pub maximum_ttl: Option<i64>,
    pub minimum_ttl: Option<i64>,
}
Expand description

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.

Fields

allowed_http_methods: Option<String>

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.

cached_http_methods: Option<String>

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.

default_ttl: Option<i64>

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.

forwarded_cookies: Option<CookieObject>

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

forwarded_headers: Option<HeaderObject>

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

forwarded_query_strings: Option<QueryStringObject>

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.

maximum_ttl: Option<i64>

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.

minimum_ttl: Option<i64>

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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more