blob: 3d31c2524c4d57a2155646339e566a720f53cff8 [file] [log] [blame]
gio59946282024-10-07 12:55:51 +04001package server
2
3import (
4 "net/http"
5)
6
7type cachingHandler struct {
8 h http.Handler
9}
10
11func NewCachingHandler(h http.Handler) http.Handler {
12 return cachingHandler{h}
13}
14
15func (h cachingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
16 w.Header().Set("Cache-Control", "max-age=604800")
17 h.h.ServeHTTP(w, r)
18}