Use Cache-Control immutable and SameSite Lax
This commit is contained in:
parent
7658e3bde7
commit
675e350da3
|
@ -58,7 +58,7 @@ func (s *Session) SetCookie(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if v := cookie.String(); v != "" {
|
if v := cookie.String(); v != "" {
|
||||||
w.Header().Add("Set-Cookie", v+"; SameSite=Strict")
|
w.Header().Add("Set-Cookie", v+"; SameSite=Lax")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import (
|
||||||
"github.com/khlieng/dispatch/assets"
|
"github.com/khlieng/dispatch/assets"
|
||||||
)
|
)
|
||||||
|
|
||||||
const longCacheControl = "public, max-age=31536000"
|
const longCacheControl = "public, max-age=31536000, immutable"
|
||||||
const disabledCacheControl = "no-cache, no-store, must-revalidate"
|
const disabledCacheControl = "no-cache, no-store, must-revalidate"
|
||||||
|
|
||||||
type File struct {
|
type File struct {
|
||||||
|
|
Loading…
Reference in New Issue