update_cache_policy¶
Operation¶
update_cache_policy
async
¶
update_cache_policy(request: UpdateCachePolicyInput | UpdateCachePolicyInputDict, /, *, plugins: list[Plugin] | None = None) -> UpdateCachePolicyOutput
update_cache_policy(*, 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 |
|---|---|---|---|
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
|
Returns:
| Type | Description |
|---|---|
UpdateCachePolicyOutput
|
An instance of |
Input¶
Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.
Model¶
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.
Dictionaries¶
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.
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.