Class CacheControl
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.s3.deployment.CacheControl
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:13.428Z")
@Stability(Stable)
public class CacheControl
extends software.amazon.jsii.JsiiObject
Used for HTTP cache-control header, which influences downstream caches.
Example:
Bucket destinationBucket;
BucketDeployment.Builder.create(this, "BucketDeployment")
.sources(List.of(Source.asset("./website", AssetOptions.builder().exclude(List.of("index.html")).build())))
.destinationBucket(destinationBucket)
.cacheControl(List.of(CacheControl.maxAge(Duration.days(365)), CacheControl.immutable()))
.prune(false)
.build();
BucketDeployment.Builder.create(this, "HTMLBucketDeployment")
.sources(List.of(Source.asset("./website", AssetOptions.builder().exclude(List.of("*", "!index.html")).build())))
.destinationBucket(destinationBucket)
.cacheControl(List.of(CacheControl.maxAge(Duration.seconds(0))))
.prune(false)
.build();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCacheControl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCacheControl(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic CacheControlfromString(String s) Constructs a custom cache control key from the literal value.getValue()The raw cache control setting.static CacheControlSets 'immutable'.static CacheControlSets 'max-age=invalid input: '<'duration-in-seconds>'.static CacheControlSets 'must-revalidate'.static CacheControlSets 'must-understand'.static CacheControlnoCache()Sets 'no-cache'.static CacheControlnoStore()Sets 'no-store'.static CacheControlSets 'no-transform'.static CacheControlSets 'proxy-revalidate'.static CacheControlSets 'private'.static CacheControlSets 'public'.static CacheControlSets 's-maxage=invalid input: '<'duration-in-seconds>'.static CacheControlSets 'stale-if-error=invalid input: '<'duration-in-seconds>'.static CacheControlSets 'stale-while-revalidate=invalid input: '<'duration-in-seconds>'.Methods 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, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
CacheControl
protected CacheControl(software.amazon.jsii.JsiiObjectRef objRef) -
CacheControl
protected CacheControl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
fromString
Constructs a custom cache control key from the literal value.- Parameters:
s- This parameter is required.
-
immutable
Sets 'immutable'. -
maxAge
Sets 'max-age=invalid input: '<'duration-in-seconds>'.- Parameters:
t- This parameter is required.
-
mustRevalidate
Sets 'must-revalidate'. -
mustUnderstand
Sets 'must-understand'. -
noCache
Sets 'no-cache'. -
noStore
Sets 'no-store'. -
noTransform
Sets 'no-transform'. -
proxyRevalidate
Sets 'proxy-revalidate'. -
setPrivate
Sets 'private'. -
setPublic
Sets 'public'. -
sMaxAge
Sets 's-maxage=invalid input: '<'duration-in-seconds>'.- Parameters:
t- This parameter is required.
-
staleIfError
Sets 'stale-if-error=invalid input: '<'duration-in-seconds>'.- Parameters:
t- This parameter is required.
-
staleWhileRevalidate
Sets 'stale-while-revalidate=invalid input: '<'duration-in-seconds>'.- Parameters:
t- This parameter is required.
-
getValue
The raw cache control setting.
-