mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-02-23 03:53:56 +00:00
Change browser cache to 10 minutes to make bigger pages more performant
This commit is contained in:
parent
726d8321e8
commit
b6d7f5a6ee
@ -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
|
// 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")
|
ctx.Response.Header.Set("Referrer-Policy", "strict-origin-when-cross-origin")
|
||||||
|
|
||||||
// Enable caching, but require revalidation to reduce confusion
|
// Enable browser caching for up to 10 minutes
|
||||||
ctx.Response.Header.Set("Cache-Control", "must-revalidate")
|
ctx.Response.Header.Set("Cache-Control", "public, max-age=600")
|
||||||
|
|
||||||
trimmedHost := TrimHostPort(ctx.Request.Host())
|
trimmedHost := TrimHostPort(ctx.Request.Host())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user