Change cache assets default example to 1 year

Why a year?
The short answer is, the protocol doesn’t allow any value longer than a year. In the absence of a “cache this asset forever” header, a year is the longest possible time we can cache for.

REF: https://ashton.codes/set-cache-control-max-age-1-year/
This commit is contained in:
Christian Oliff 2019-12-12 21:06:07 +09:00 committed by Bjørn Erik Pedersen
parent 676dc6e12e
commit 0f82420b86

View File

@ -90,14 +90,14 @@ cloudFrontDistributionID = <ID>
# Samples: # Samples:
[[deployment.matchers]] [[deployment.matchers]]
# Cache static assets for 20 years. # Cache static assets for 1 year.
pattern = "^.+\\.(js|css|svg|ttf)$" pattern = "^.+\\.(js|css|svg|ttf)$"
cacheControl = "max-age=630720000, no-transform, public" cacheControl = "max-age=31536000, no-transform, public"
gzip = true gzip = true
[[deployment.matchers]] [[deployment.matchers]]
pattern = "^.+\\.(png|jpg)$" pattern = "^.+\\.(png|jpg)$"
cacheControl = "max-age=630720000, no-transform, public" cacheControl = "max-age=31536000, no-transform, public"
gzip = false gzip = false
[[deployment.matchers]] [[deployment.matchers]]