# ICachePolicy

Represents a Cache Policy.

Extends: [ICachePolicyRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_cloudfront.ICachePolicyRef.html)
Implemented by: [CachePolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html)
Obtainable from: [CachePolicy.AMPLIFY](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html#amplify), [CachePolicy.CACHING_DISABLED](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html#caching-disabled), [CachePolicy.CACHING_OPTIMIZED](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html#caching-optimized), [CachePolicy.CACHING_OPTIMIZED_FOR_UNCOMPRESSED_OBJECTS](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html#caching-optimized-for-uncompressed-objects), [CachePolicy.ELEMENTAL_MEDIA_PACKAGE](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html#elemental-media-package), [CachePolicy.USE_ORIGIN_CACHE_CONTROL_HEADERS](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html#use-origin-cache-control-headers), [CachePolicy.USE_ORIGIN_CACHE_CONTROL_HEADERS_QUERY_STRINGS](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html#use-origin-cache-control-headers-query-strings), [CachePolicy.fromCachePolicyId](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CachePolicy.html#fromcachepolicyid)

- Source: [`aws-cloudfront/lib/cache-policy.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudfront/lib/cache-policy.ts#L22)
- Type last changed: v2.224.0 · 13 Nov 2025

## Properties

- `cachePolicyId`: string — The ID of the cache policy.

- `cachePolicyRef`: [CachePolicyReference](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_cloudfront.CachePolicyReference.html) — A reference to a CachePolicy resource.

- `env`: [ResourceEnvironment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `node`: [Node](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html) — The tree node.

## Methods

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
