Skip to content

Configure Cloudfront/S3 Caching Behavior #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions master_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -649,10 +649,13 @@ deploy_s3bucket() {
cat /etc/mime.types | grep -i map
cat /etc/mime.types | grep -i ttf
if [ "$CFCACHE" = "true" ]; then
S3_CACHE_OPTIONS="--cache-control private,no-store,no-cache,must-revalidate,max-age=0"
echo "*** Deploying with Cloudfront Cache disabled ***"
# caching is enabled, so set the cache control's max age
S3_CACHE_OPTIONS="--cache-control max-age=0,s-maxage=86400"
echo "*** Deploying with Cloudfront Cache enabled ***"
else
S3_CACHE_OPTIONS="--cache-control max-age=0,s-maxage=86400"
# caching is disabled, so set the cache control to never cache
S3_CACHE_OPTIONS="--cache-control private,no-store,no-cache,must-revalidate,max-age=0"
echo "*** Deploying with Cloudfront Cache disabled ***"
fi

S3_OPTIONS="--exclude '*.txt' --exclude '*.js' --exclude '*.css'"
Expand Down