From 0f82420b86b784440b1fc472a8232bdfe104895e Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Thu, 12 Dec 2019 21:06:07 +0900 Subject: [PATCH] Change cache assets default example to 1 year MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/ --- content/en/hosting-and-deployment/hugo-deploy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/hosting-and-deployment/hugo-deploy.md b/content/en/hosting-and-deployment/hugo-deploy.md index bce606d1f..81436b7f3 100644 --- a/content/en/hosting-and-deployment/hugo-deploy.md +++ b/content/en/hosting-and-deployment/hugo-deploy.md @@ -90,14 +90,14 @@ cloudFrontDistributionID = # Samples: [[deployment.matchers]] -# Cache static assets for 20 years. +# Cache static assets for 1 year. pattern = "^.+\\.(js|css|svg|ttf)$" -cacheControl = "max-age=630720000, no-transform, public" +cacheControl = "max-age=31536000, no-transform, public" gzip = true [[deployment.matchers]] pattern = "^.+\\.(png|jpg)$" -cacheControl = "max-age=630720000, no-transform, public" +cacheControl = "max-age=31536000, no-transform, public" gzip = false [[deployment.matchers]]