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.max_age(Duration.days(365)), s3deploy.CacheControl.immutable() ], prune=False ) s3deploy.BucketDeployment(self, "HTMLBucketDeployment", sources=[s3deploy.Source.asset("./website", exclude=["*", "!index.html"])], destination_bucket=destination_bucket, cache_control=[ s3deploy.CacheControl.max_age(Duration.seconds(0)) ], 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 immutable()
Sets ‘immutable’.
- Return type:
- classmethod must_revalidate()
Sets ‘must-revalidate’.
- Return type:
- classmethod must_understand()
Sets ‘must-understand’.
- Return type:
- classmethod no_cache()
Sets ‘no-cache’.
- Return type:
- classmethod no_store()
Sets ‘no-store’.
- 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: