@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:46.374Z") public class CachePolicy extends Resource implements ICachePolicy
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();
Modifier and Type | Class and Description |
---|---|
static class |
CachePolicy.Builder
A fluent builder for
CachePolicy . |
ICachePolicy.Jsii$Default, ICachePolicy.Jsii$Proxy
IResource.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static ICachePolicy |
AMPLIFY
This policy is designed for use with an origin that is an AWS Amplify web app.
|
static ICachePolicy |
CACHING_DISABLED
Disables caching.
|
static ICachePolicy |
CACHING_OPTIMIZED
Optimize cache efficiency by minimizing the values that CloudFront includes in the cache key.
|
static ICachePolicy |
CACHING_OPTIMIZED_FOR_UNCOMPRESSED_OBJECTS
Optimize cache efficiency by minimizing the values that CloudFront includes in the cache key.
|
static ICachePolicy |
ELEMENTAL_MEDIA_PACKAGE
Designed for use with an origin that is an AWS Elemental MediaPackage endpoint.
|
Modifier | Constructor and Description |
---|---|
protected |
CachePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CachePolicy(software.amazon.jsii.JsiiObjectRef objRef) |
|
CachePolicy(software.constructs.Construct scope,
java.lang.String id) |
|
CachePolicy(software.constructs.Construct scope,
java.lang.String id,
CachePolicyProps props) |
Modifier and Type | Method and Description |
---|---|
static ICachePolicy |
fromCachePolicyId(software.constructs.Construct scope,
java.lang.String id,
java.lang.String cachePolicyId)
Imports a Cache Policy from its id.
|
java.lang.String |
getCachePolicyId()
The ID of the cache policy.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNode
public static final ICachePolicy AMPLIFY
public static final ICachePolicy CACHING_DISABLED
This policy is useful for dynamic content and for requests that are not cacheable.
public static final ICachePolicy CACHING_OPTIMIZED
Query strings and cookies are not included in the cache key, and only the normalized 'Accept-Encoding' header is included.
public static final ICachePolicy CACHING_OPTIMIZED_FOR_UNCOMPRESSED_OBJECTS
Query strings and cookies are not included in the cache key, and only the normalized 'Accept-Encoding' header is included. Disables cache compression.
public static final ICachePolicy ELEMENTAL_MEDIA_PACKAGE
protected CachePolicy(software.amazon.jsii.JsiiObjectRef objRef)
protected CachePolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CachePolicy(software.constructs.Construct scope, java.lang.String id, CachePolicyProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public CachePolicy(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static ICachePolicy fromCachePolicyId(software.constructs.Construct scope, java.lang.String id, java.lang.String cachePolicyId)
scope
- This parameter is required.id
- This parameter is required.cachePolicyId
- This parameter is required.public java.lang.String getCachePolicyId()
getCachePolicyId
in interface ICachePolicy