CacheControl
- class aws_cdk.aws_s3_deployment.CacheControl(*args: Any, **kwargs)
Bases:
object
Used for HTTP cache-control header, which influences downstream caches.
- See:
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- ExampleMetadata:
infused
Example:
# destination_bucket: s3.Bucket s3deploy.BucketDeployment(self, "BucketDeployment", sources=[s3deploy.Source.asset("./website", exclude=["index.html"])], destination_bucket=destination_bucket, cache_control=[s3deploy.CacheControl.from_string("max-age=31536000,public,immutable")], prune=False ) s3deploy.BucketDeployment(self, "HTMLBucketDeployment", sources=[s3deploy.Source.asset("./website", exclude=["*", "!index.html"])], destination_bucket=destination_bucket, cache_control=[s3deploy.CacheControl.from_string("max-age=0,no-cache,no-store,must-revalidate")], prune=False )
Attributes
- value
The raw cache control setting.
Static Methods
- classmethod from_string(s)
Constructs a custom cache control key from the literal value.
- Parameters:
s (
str
)- Return type:
- classmethod must_revalidate()
Sets ‘must-revalidate’.
- Return type:
- classmethod no_cache()
Sets ‘no-cache’.
- Return type:
- classmethod no_transform()
Sets ‘no-transform’.
- Return type:
- classmethod proxy_revalidate()
Sets ‘proxy-revalidate’.
- Return type:
- classmethod set_private()
Sets ‘private’.
- Return type:
- classmethod set_public()
Sets ‘public’.
- Return type: