Class CachePolicy
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.cloudfront.CachePolicy
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,ICachePolicy
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:43.445Z")
@Stability(Stable)
public class CachePolicy
extends Resource
implements ICachePolicy
A Cache Policy configuration.
Example:
// Using an existing cache policy for a Distribution S3Origin bucketOrigin; Distribution.Builder.create(this, "myDistManagedPolicy") .defaultBehavior(BehaviorOptions.builder() .origin(bucketOrigin) .cachePolicy(CachePolicy.CACHING_OPTIMIZED) .build()) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.cloudfront.ICachePolicy
ICachePolicy.Jsii$Default, ICachePolicy.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ICachePolicy
This policy is designed for use with an origin that is an AWS Amplify web app.static final ICachePolicy
Disables caching.static final ICachePolicy
Optimize cache efficiency by minimizing the values that CloudFront includes in the cache key.static final ICachePolicy
Optimize cache efficiency by minimizing the values that CloudFront includes in the cache key.static final ICachePolicy
Designed for use with an origin that is an AWS Elemental MediaPackage endpoint. -
Constructor Summary
ModifierConstructorDescriptionprotected
CachePolicy
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CachePolicy
(software.amazon.jsii.JsiiObjectRef objRef) CachePolicy
(software.constructs.Construct scope, String id) CachePolicy
(software.constructs.Construct scope, String id, CachePolicyProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic ICachePolicy
fromCachePolicyId
(software.constructs.Construct scope, String id, String cachePolicyId) Imports a Cache Policy from its id.The ID of the cache policy.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
AMPLIFY
This policy is designed for use with an origin that is an AWS Amplify web app. -
CACHING_DISABLED
Disables caching.This policy is useful for dynamic content and for requests that are not cacheable.
-
CACHING_OPTIMIZED
Optimize cache efficiency by minimizing the values that CloudFront includes in the cache key.Query strings and cookies are not included in the cache key, and only the normalized 'Accept-Encoding' header is included.
-
CACHING_OPTIMIZED_FOR_UNCOMPRESSED_OBJECTS
Optimize cache efficiency by minimizing the values that CloudFront includes in the cache key.Query strings and cookies are not included in the cache key, and only the normalized 'Accept-Encoding' header is included. Disables cache compression.
-
ELEMENTAL_MEDIA_PACKAGE
Designed for use with an origin that is an AWS Elemental MediaPackage endpoint.
-
-
Constructor Details
-
CachePolicy
protected CachePolicy(software.amazon.jsii.JsiiObjectRef objRef) -
CachePolicy
protected CachePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CachePolicy
@Stability(Stable) public CachePolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CachePolicyProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
CachePolicy
@Stability(Stable) public CachePolicy(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
fromCachePolicyId
@Stability(Stable) @NotNull public static ICachePolicy fromCachePolicyId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String cachePolicyId) Imports a Cache Policy from its id.- Parameters:
scope
- This parameter is required.id
- This parameter is required.cachePolicyId
- This parameter is required.
-
getCachePolicyId
The ID of the cache policy.- Specified by:
getCachePolicyId
in interfaceICachePolicy
-