Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When using S3 to server web site content (both in conjunction with CloudFront and not) you will may want to set Cache Control headers for browsers or CloudFront to use.

 

Using AWS s3api CLI:

Code Block
$ aws s3api put-object --bucket mybucket --key index.html --cache-control max-age=3600 --body www-files/index.html 
{
    "ETag": "\"63525d1b04aeb5d301de2acc498480b3\"", 
    "ServerSideEncryption": "AES256"
} 

Using AWS s3 CLI:

Code Block
$ aws s3 sync www-files s3://mybucket/ --cache-control max-age=3600
upload: www-files/index.html to s3://mybucket/index.html