func handler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") // ... }
func handler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Cache-Control", "max-age=3600") w.Header().Set("Expires", time.Now().Add(time.Minute*60).Format(http.TimeFormat)) // ... }The net/http package is used in the above examples.