@@ -649,10 +649,13 @@ deploy_s3bucket() {
649
649
cat /etc/mime.types | grep -i map
650
650
cat /etc/mime.types | grep -i ttf
651
651
if [ " $CFCACHE " = " true" ]; then
652
- S3_CACHE_OPTIONS=" --cache-control private,no-store,no-cache,must-revalidate,max-age=0"
653
- echo " *** Deploying with Cloudfront Cache disabled ***"
652
+ # caching is enabled, so set the cache control's max age
653
+ S3_CACHE_OPTIONS=" --cache-control max-age=0,s-maxage=86400"
654
+ echo " *** Deploying with Cloudfront Cache enabled ***"
654
655
else
655
- S3_CACHE_OPTIONS=" --cache-control max-age=0,s-maxage=86400"
656
+ # caching is disabled, so set the cache control to never cache
657
+ S3_CACHE_OPTIONS=" --cache-control private,no-store,no-cache,must-revalidate,max-age=0"
658
+ echo " *** Deploying with Cloudfront Cache disabled ***"
656
659
fi
657
660
658
661
S3_OPTIONS=" --exclude '*.txt' --exclude '*.js' --exclude '*.css'"
@@ -721,7 +724,7 @@ check_invalidation_status() {
721
724
722
725
invalidate_cf_cache ()
723
726
{
724
- if [ " $CFCACHE " = " true" ]; then
727
+ # if [ "$CFCACHE" = "true" ]; then
725
728
if [ -z $AWS_CLOUD_FRONT_ID ]; then
726
729
echo " Based on header applicaiton has invalidated"
727
730
echo " Skipped which is based on AWS cloudfront ID.Kindly raise request to configure cloud front ID in deployment configuration"
@@ -730,7 +733,7 @@ invalidate_cf_cache()
730
733
INVALIDATE_ID=` aws cloudfront create-invalidation --distribution-id $AWS_CLOUD_FRONT_ID --paths ' /*' | $JQ ' .Invalidation.Id' `
731
734
check_invalidation_status " $INVALIDATE_ID "
732
735
fi
733
- fi
736
+ # fi
734
737
}
735
738
736
739
download_envfile ()
0 commit comments