aws s3 cp \
--content-type "application/json; charset=utf-8" \
--cache-control 'public, max-age=300' \
--metadata-directive REPLACE \
"$MY_FILE" \
"s3://$BUCKET_NAME/$MY_FILE" \
; \
sleep 60
; \
aws s3api head-object \
--bucket "$BUCKET_NAME" \
--key "$MY_FILE" \
--output json |
jq -r '.CacheControl'
# public, max-age=259200, stale-while-revalidate=3600, stale-if-error=600
aws s3 cp \
--content-type "application/json; charset=utf-8" \
--cache-control 'public, max-age=300' \
--metadata-directive REPLACE \
"$MY_FILE" \
"s3://$BUCKET_NAME/$MY_FILE" \
; \
sleep 60
; \
aws s3api head-object \
--bucket "$BUCKET_NAME" \
--key "$MY_FILE" \
--output json |
jq -r '.CacheControl'
# public, max-age=259200, stale-while-revalidate=3600, stale-if-error=600