diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-08-21 14:10:15 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-08-21 14:20:44 -0400 |
| commit | 39660d978304ebce08a9200f4ef63c0013cab7ac (patch) | |
| tree | 68f1b7f77e1690d5e7021cb221f454dff146905f /internal | |
| parent | de3aa62dbc608ec1fbcf676275340644ed1fd031 (diff) | |
| download | x-39660d978304ebce08a9200f4ef63c0013cab7ac.tar.xz x-39660d978304ebce08a9200f4ef63c0013cab7ac.zip | |
cmd/hdrwtch: closer to implementation
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/headers.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/headers.go b/internal/headers.go new file mode 100644 index 0000000..3461ed1 --- /dev/null +++ b/internal/headers.go @@ -0,0 +1,10 @@ +package internal + +import "net/http" + +func UnchangingCache(h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Cache-Control", "public, max-age=31536000") + h.ServeHTTP(w, r) + }) +} |
