From b3cd1ee33ed9a5783c19d8cb18927e80e8b34814 Mon Sep 17 00:00:00 2001 From: Moritz Marquardt Date: Thu, 2 Dec 2021 10:23:03 +0100 Subject: [PATCH] Change browser cache to 10 minutes to make bigger pages more performant --- handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler.go b/handler.go index 44865ac..c5fe1d9 100644 --- a/handler.go +++ b/handler.go @@ -25,8 +25,8 @@ func handler(ctx *fasthttp.RequestCtx) { // Force new default from specification (since November 2020) - see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#strict-origin-when-cross-origin ctx.Response.Header.Set("Referrer-Policy", "strict-origin-when-cross-origin") - // Enable caching, but require revalidation to reduce confusion - ctx.Response.Header.Set("Cache-Control", "must-revalidate") + // Enable browser caching for up to 10 minutes + ctx.Response.Header.Set("Cache-Control", "public, max-age=600") trimmedHost := TrimHostPort(ctx.Request.Host())