Skip to content

Commit

Permalink
chore(cloudfront): adding Managed cache policy (aws#30797)
Browse files Browse the repository at this point in the history
### Reason for this change

This Updated.

https://aws.amazon.com/jp/about-aws/whats-new/2024/07/amazon-cloudfront-managed-cache-policies-web-applications/

### Description of changes

Adding Managed Cache Policies.

- [UseOriginCacheControlHeaders](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html#managed-cache-policy-origin-cache-headers)
- [UseOriginCacheControlHeaders-QueryStrings](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html#managed-cache-policy-origin-cache-headers-query-strings)

### Description of how you validated changes

no

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
watany-dev authored Jul 26, 2024
1 parent 8b935a6 commit 5f3337f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/aws-cdk-lib/aws-cloudfront/lib/cache-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ export class CachePolicy extends Resource implements ICachePolicy {
/** Designed for use with an origin that is an AWS Elemental MediaPackage endpoint. */
public static readonly ELEMENTAL_MEDIA_PACKAGE = CachePolicy.fromManagedCachePolicy('08627262-05a9-4f76-9ded-b50ca2e3a84f');

/**
* Designed for use with an origin that returns Cache-Control HTTP response headers and does not serve different content based on values present in the query string.
*/
public static readonly USE_ORIGIN_CACHE_CONTROL_HEADERS = CachePolicy.fromManagedCachePolicy('83da9c7e-98b4-4e11-a168-04f0df8e2c65');

/**
* Designed for use with an origin that returns Cache-Control HTTP response headers and serves different content based on values present in the query string.
*/
public static readonly USE_ORIGIN_CACHE_CONTROL_HEADERS_QUERY_STRINGS = CachePolicy.fromManagedCachePolicy('4cc15a8a-d715-48a4-82b8-cc0b614638fe');

/** Imports a Cache Policy from its id. */
public static fromCachePolicyId(scope: Construct, id: string, cachePolicyId: string): ICachePolicy {
return new class extends Resource implements ICachePolicy {
Expand Down

0 comments on commit 5f3337f

Please sign in to comment.