mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-18 11:24:39 -04:00
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:
parent
676dc6e12e
commit
0f82420b86
@ -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]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user