Cache static assets longer

This commit is contained in:
Seth Vargo 2017-02-09 14:40:39 -05:00 committed by GitHub
parent 8c311daa72
commit c80e6671e2
1 changed files with 3 additions and 1 deletions

View File

@ -64,6 +64,7 @@ if [ -z "$NO_UPLOAD" ]; then
echo "Overriding javascript mime-types..."
s3cmd \
--mime-type="application/javascript" \
--add-header="Cache-Control: max-age=31536000" \
--exclude "*" \
--include "*.js" \
--recursive \
@ -72,6 +73,7 @@ if [ -z "$NO_UPLOAD" ]; then
echo "Overriding css mime-types..."
s3cmd \
--mime-type="text/css" \
--add-header="Cache-Control: max-age=31536000" \
--exclude "*" \
--include "*.css" \
--recursive \
@ -80,12 +82,12 @@ if [ -z "$NO_UPLOAD" ]; then
echo "Overriding svg mime-types..."
s3cmd \
--mime-type="image/svg+xml" \
--add-header="Cache-Control: max-age=31536000" \
--exclude "*" \
--include "*.svg" \
--recursive \
modify "s3://hc-sites/$PROJECT/latest/"
fi
# Perform a soft-purge of the surrogate key.
if [ -z "$NO_PURGE" ]; then
echo "Purging Fastly cache..."