Skip to content

Commit

Permalink
feat: add cache duration of one hour
Browse files Browse the repository at this point in the history
  • Loading branch information
drawbu committed Nov 4, 2024
1 parent 8f6c899 commit e758708
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ func (serv *Server) AddRoute(route string, handler func(app *Server, w http.Resp
http.HandleFunc(route, func(w http.ResponseWriter, r *http.Request) {
log_fmt := fmt.Sprintf("[%s] %s", r.Method, r.RequestURI)

w.Header().Add("Cache-Control", "no-cache, must-revalidate")
// Cache duration is one hour
w.Header().Add("Cache-Control", "max-age=3600")
w.Header().Add("Vary", "HX-Request")
is_htmx := r.Header.Get("HX-Request") == "true"

Expand Down

0 comments on commit e758708

Please sign in to comment.