mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-20 11:58:39 +00:00
client/web: only add cache header for assets
Updates #10261 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
parent
808f19bf01
commit
06af3e3014
@ -52,10 +52,12 @@ func assetsHandler(devMode bool) (_ http.Handler, cleanup func()) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aggressively cache static assets, since we cache-bust our assets with
|
if strings.HasPrefix(path, "assets/") {
|
||||||
// hashed filenames.
|
// Aggressively cache static assets, since we cache-bust our assets with
|
||||||
w.Header().Set("Cache-Control", "public, max-age=31535996")
|
// hashed filenames.
|
||||||
w.Header().Set("Vary", "Accept-Encoding")
|
w.Header().Set("Cache-Control", "public, max-age=31535996")
|
||||||
|
w.Header().Set("Vary", "Accept-Encoding")
|
||||||
|
}
|
||||||
|
|
||||||
http.ServeContent(w, r, path, start, fSeeker)
|
http.ServeContent(w, r, path, start, fSeeker)
|
||||||
}), nil
|
}), nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user