Skip to content

Commit

Permalink
Add default Cache-Control header
Browse files Browse the repository at this point in the history
  • Loading branch information
toshinari123 authored and kiootic committed Feb 20, 2024
1 parent 859784c commit d3737dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*.test
*.out
go.work

*.local
.env
dist/
/book
/book
1 change: 1 addition & 0 deletions internal/handler/site/site_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (h *SiteHandler) serveFile(w http.ResponseWriter, r *http.Request) {
}
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{
Expand Down

0 comments on commit d3737dc

Please sign in to comment.