Skip to content

CacheSettings

Source code in docs_src/capo_lightsail/types/cache_settings.py
class CacheSettings(TypedDict, closed=True):
    default_ttl: NotRequired["capo_lightsail.types.long.long"]
    """<p>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.</p> <note> <p>The value specified applies only when the origin does not add HTTP headers such as <code>Cache-Control max-age</code>, <code>Cache-Control s-maxage</code>, and <code>Expires</code> to objects.</p> </note>"""
    minimum_ttl: NotRequired["capo_lightsail.types.long.long"]
    """<p>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.</p> <p>A value of <code>0</code> must be specified for <code>minimumTTL</code> if the distribution is configured to forward all headers to the origin.</p>"""
    maximum_ttl: NotRequired["capo_lightsail.types.long.long"]
    """<p>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.</p> <p>The value specified applies only when the origin adds HTTP headers such as <code>Cache-Control max-age</code>, <code>Cache-Control s-maxage</code>, and <code>Expires</code> to objects.</p>"""
    allowed_http_methods: NotRequired[
        "capo_lightsail.types.non_empty_string.NonEmptyString"
    ]
    """<p>The HTTP methods that are processed and forwarded to the distribution's origin.</p> <p>You can specify the following options:</p> <ul> <li> <p> <code>GET,HEAD</code> - The distribution forwards the <code>GET</code> and <code>HEAD</code> methods.</p> </li> <li> <p> <code>GET,HEAD,OPTIONS</code> - The distribution forwards the <code>GET</code>, <code>HEAD</code>, and <code>OPTIONS</code> methods.</p> </li> <li> <p> <code>GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE</code> - The distribution forwards the <code>GET</code>, <code>HEAD</code>, <code>OPTIONS</code>, <code>PUT</code>, <code>PATCH</code>, <code>POST</code>, and <code>DELETE</code> methods.</p> </li> </ul> <p>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.</p>"""
    cached_http_methods: NotRequired[
        "capo_lightsail.types.non_empty_string.NonEmptyString"
    ]
    """<p>The HTTP method responses that are cached by your distribution.</p> <p>You can specify the following options:</p> <ul> <li> <p> <code>GET,HEAD</code> - The distribution caches responses to the <code>GET</code> and <code>HEAD</code> methods.</p> </li> <li> <p> <code>GET,HEAD,OPTIONS</code> - The distribution caches responses to the <code>GET</code>, <code>HEAD</code>, and <code>OPTIONS</code> methods.</p> </li> </ul>"""
    forwarded_cookies: NotRequired["capo_lightsail.types.cookie_object.CookieObject"]
    """<p>An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.</p>"""
    forwarded_headers: NotRequired["capo_lightsail.types.header_object.HeaderObject"]
    """<p>An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.</p>"""
    forwarded_query_strings: NotRequired[
        "capo_lightsail.types.query_string_object.QueryStringObject"
    ]
    """<p>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.</p>"""

allowed_http_methods instance-attribute

allowed_http_methods: NotRequired[NonEmptyString]

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 instance-attribute

cached_http_methods: NotRequired[NonEmptyString]

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 instance-attribute

default_ttl: NotRequired[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.

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 instance-attribute

forwarded_cookies: NotRequired[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 instance-attribute

forwarded_headers: NotRequired[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 instance-attribute

forwarded_query_strings: NotRequired[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 instance-attribute

maximum_ttl: NotRequired[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.

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 instance-attribute

minimum_ttl: NotRequired[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.

A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin.