diff --git a/.gitignore b/.gitignore index edc180d..8f5ad8b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,8 @@ *.test *.out go.work - +pageship *.local .env dist/ -/book \ No newline at end of file +/book diff --git a/internal/handler/site/site_handler.go b/internal/handler/site/site_handler.go index 04e64ed..4b001c8 100644 --- a/internal/handler/site/site_handler.go +++ b/internal/handler/site/site_handler.go @@ -49,7 +49,6 @@ func (h *SiteHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } h.next.ServeHTTP(w, r) - w.Header().Set("Cache-Control", "public, max-age=31536000, no-cache") case http.MethodOptions: w.Header().Set("Allow", options) @@ -72,9 +71,9 @@ func (h *SiteHandler) serveFile(w http.ResponseWriter, r *http.Request) { if info.ContentType != "" { w.Header().Set("Content-Type", info.ContentType) } - w.Header().Set("Cache-Control", "public, max-age=31536000, no-cache") if info.Hash != "" { w.Header().Set("ETag", fmt.Sprintf(`"%s"`, info.Hash)) + w.Header().Set("Cache-Control", "public, max-age=31536000, no-cache") } reader := &lazyReader{