Merge pull request #2377 from hashicorp/sethvargo/cache

Update caching
This commit is contained in:
Seth Vargo 2017-02-28 15:53:08 -05:00 committed by GitHub
commit ab2f399ac8
1 changed files with 4 additions and 0 deletions

View File

@ -48,6 +48,9 @@ if [ -z "$NO_UPLOAD" ]; then
exit 1
fi
# Set browser-side cache-control to ~4h, but tell Fastly to cache for much
# longer. We manually purge the Fastly cache, so setting it to a year is more
# than fine.
s3cmd \
--quiet \
--delete-removed \
@ -56,6 +59,7 @@ if [ -z "$NO_UPLOAD" ]; then
--acl-public \
--recursive \
--add-header="Cache-Control: max-age=14400" \
--add-header="x-amz-meta-surrogate-control: max-age=31536000" \
--add-header="x-amz-meta-surrogate-key: site-$PROJECT" \
sync "$DIR/build/" "s3://hc-sites/$PROJECT/latest/"