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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.cloudfront.ICachePolicy
ICachePolicy.Jsii$Default, ICachePolicy.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ICachePolicyThis policy is designed for use with an origin that is an AWS Amplify web app.static final ICachePolicyDisables caching.static final ICachePolicyOptimize cache efficiency by minimizing the values that CloudFront includes in the cache key.static final ICachePolicyOptimize cache efficiency by minimizing the values that CloudFront includes in the cache key.static final ICachePolicyDesigned for use with an origin that is an AWS Elemental MediaPackage endpoint. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCachePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCachePolicy(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 ICachePolicyfromCachePolicyId(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, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.Construct
toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.core.IConstruct
getNodeMethods 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:
getCachePolicyIdin interfaceICachePolicy
-