Skip to content
v2.274.0

CfnCachePolicyPropsMixin Mixin ​

A cache policy.

When it's attached to a cache behavior, the cache policy determines the following:

  • The values that CloudFront includes in the cache key. These values can include HTTP headers, cookies, and URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer.
  • The default, minimum, and maximum time to live (TTL) values that you want objects to stay in the CloudFront cache.

The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find a valid object in its cache that matches the request's cache key. If you want to send values to the origin but not include them in the cache key, use OriginRequestPolicy .

Initializer ​

ts
new CfnCachePolicyPropsMixin(props: CfnCachePolicyMixinProps, options?: CfnPropertyMixinOptions)
python
CfnCachePolicyPropsMixin(props: CfnCachePolicyMixinProps, options: typing.Optional[CfnPropertyMixinOptions] = None)
java
new CfnCachePolicyPropsMixin(CfnCachePolicyMixinProps props, CfnPropertyMixinOptions options)
csharp
new CfnCachePolicyPropsMixin(CfnCachePolicyMixinProps props, CfnPropertyMixinOptions? options = null)
go
NewCfnCachePolicyPropsMixin(Props CfnCachePolicyMixinProps, Options CfnPropertyMixinOptions)

Methods ​

applyTo(construct: IConstruct): voiddef apply_to(self, construct: IConstruct) -> Nonepublic void applyTo(IConstruct construct)public void ApplyTo(IConstruct construct)func ApplyTo(Construct IConstruct)#
Apply the mixin properties to the construct.
isMixin(x: any): boolean@staticmethod def is_mixin(x: Any) -> boolpublic static Boolean isMixin(Object x)public static bool IsMixin(object x)func IsMixin(X interface{}) *boolstatic#
Checks if `x` is a Mixin.
1 parameter · returns

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Mixin.

supports(construct: IConstruct): booleandef supports(self, construct: IConstruct) -> boolpublic Boolean supports(IConstruct construct)public bool Supports(IConstruct construct)func Supports(Construct IConstruct) *bool#
Check if this mixin supports the given construct.