mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 20:17:17 +00: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:
1 parent
676dc6e12e
commit
0f82420b86
1 file changed
+3
-3
@@ -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]]
|
||||||
|
|||||||
Reference in new issue
Block a user