AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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:

  1. Use GetCachePolicyConfig to get the current configuration.

  2. Locally modify the fields in the cache policy configuration that you want to update.

  3. Call UpdateCachePolicy by providing the entire cache policy configuration, including the fields that you modified and those that you didn't.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to UpdateCachePolicyAsync.

Namespace: Amazon.CloudFront
Assembly: AWSSDK.CloudFront.dll
Version: 3.x.y.z

Syntax

C#
public virtual UpdateCachePolicyResponse UpdateCachePolicy(
         UpdateCachePolicyRequest request
)

Parameters

request
Type: Amazon.CloudFront.Model.UpdateCachePolicyRequest

Container for the necessary parameters to execute the UpdateCachePolicy service method.

Return Value


The response from the UpdateCachePolicy service method, as returned by CloudFront.

Exceptions

ExceptionCondition
AccessDeniedException Access denied.
CachePolicyAlreadyExistsException A cache policy with this name already exists. You must provide a unique name. To modify an existing cache policy, use UpdateCachePolicy.
IllegalUpdateException The update contains modifications that are not allowed.
InconsistentQuantitiesException The value of Quantity and the size of Items don't match.
InvalidArgumentException An argument is invalid.
InvalidIfMatchVersionException The If-Match version is missing or not valid.
NoSuchCachePolicyException The cache policy does not exist.
PreconditionFailedException The precondition in one or more of the request fields evaluated to false.
TooManyCookiesInCachePolicyException The number of cookies in the cache policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
TooManyHeadersInCachePolicyException The number of headers in the cache policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
TooManyQueryStringsInCachePolicyException The number of query strings in the cache policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also