update_cache_policy¶
Operation¶
update_cache_policy
¶
update_cache_policy(request: UpdateCachePolicyInput | UpdateCachePolicyInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateCachePolicyInputDict]) -> UpdateCachePolicyOutput
Updates a cache policy configuration.
When you update a cache policy configuration, all the fields are updated with the values provided in the request. You cannot update some fields independent of others. To update a cache policy configuration:
-
Use
GetCachePolicyConfigto get the current configuration. -
Locally modify the fields in the cache policy configuration that you want to update.
-
Call
UpdateCachePolicyby providing the entire cache policy configuration, including the fields that you modified and those that you didn't.
Warning
If your minimum TTL is greater than 0, CloudFront will cache content for
at least the duration specified in the cache policy's minimum TTL, even
if the Cache-Control: no-cache, no-store, or private directives
are present in the origin headers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateCachePolicyInput | UpdateCachePolicyInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[UpdateCachePolicyInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateCachePolicyOutput
|
An instance of |
update_cache_policy
async
¶
update_cache_policy(request: UpdateCachePolicyInput | UpdateCachePolicyInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateCachePolicyInputDict]) -> UpdateCachePolicyOutput
Updates a cache policy configuration.
When you update a cache policy configuration, all the fields are updated with the values provided in the request. You cannot update some fields independent of others. To update a cache policy configuration:
-
Use
GetCachePolicyConfigto get the current configuration. -
Locally modify the fields in the cache policy configuration that you want to update.
-
Call
UpdateCachePolicyby providing the entire cache policy configuration, including the fields that you modified and those that you didn't.
Warning
If your minimum TTL is greater than 0, CloudFront will cache content for
at least the duration specified in the cache policy's minimum TTL, even
if the Cache-Control: no-cache, no-store, or private directives
are present in the origin headers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateCachePolicyInput | UpdateCachePolicyInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[UpdateCachePolicyInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateCachePolicyOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
UpdateCachePolicyInputDict
¶
Bases: TypedDict
Dictionary form of UpdateCachePolicyInput.
Attributes¶
cache_policy_config
instance-attribute
¶
cache_policy_config: Required[CachePolicyConfig | CachePolicyConfigDict]
A cache policy configuration.
id
instance-attribute
¶
The unique identifier for the cache policy that you are updating. The
identifier is returned in a cache behavior's CachePolicyId field in
the response to GetDistributionConfig.
UpdateCachePolicyInput
dataclass
¶
Bases: _SerdeShape
Dataclass for UpdateCachePolicyInput structure.
Attributes¶
cache_policy_config
class-attribute
instance-attribute
¶
cache_policy_config: CachePolicyConfig | None = ...
A cache policy configuration.
Output¶
UpdateCachePolicyOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for UpdateCachePolicyOutput structure.
Attributes¶
cache_policy
class-attribute
instance-attribute
¶
cache_policy: CachePolicy | None = ...
A cache policy.
e_tag
class-attribute
instance-attribute
¶
e_tag: str | None = ...
The current version of the cache policy.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.