From 9e4a946d74dd86fb825c4f1b381681297acc7046 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 7 Oct 2019 15:57:53 +0200 Subject: [PATCH] properly set cache headers * turns out S3 does not allow modifying cache-control headers once they are set, resulting in our 2nd part of s3sync being ignored * fix by explicetly excluding, and then including the respective files --- scripts/deploy.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 54cdd674..1d0f02c0 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -13,6 +13,15 @@ set -e; function s3sync { aws s3 sync ./public s3://"$1" \ + --include "*" \ + --exclude "*.html" \ + --exclude "sw.js" \ + --exclude "*page-data.json" \ + --exclude "chunk-map.json" \ + --exclude "sitemap.xml" \ + --exclude ".iconstats.json" \ + --exclude "humans.txt" \ + --exclude "robots.txt" \ --cache-control public,max-age=31536000,immutable \ --delete \ --acl public-read @@ -21,9 +30,11 @@ function s3sync { --exclude "*" \ --include "*.html" \ --include "sw.js" \ + --include "*page-data.json" \ --include "chunk-map.json" \ --include "sitemap.xml" \ --include ".iconstats.json" \ + --include "humans.txt" \ --include "robots.txt" \ --cache-control public,max-age=0,must-revalidate \ --delete \