summaryrefslogtreecommitdiff
path: root/pkg/webui/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/webui/cache.go')
-rw-r--r--pkg/webui/cache.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/webui/cache.go b/pkg/webui/cache.go
new file mode 100644
index 0000000..cef999b
--- /dev/null
+++ b/pkg/webui/cache.go
@@ -0,0 +1,10 @@
+package webui
+
+import "net/http"
+
+func cache(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Cache-Control", "public, max-age=31536000, immutable")
+ next.ServeHTTP(w, r)
+ })
+}