Browse Source

Merge pull request #33 from bnprss/cacheControl

correct Cache-contol header missusage.
Sergey Alexandrovich 7 years ago
parent
commit
ecbbd5e3f5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      server.go

+ 1 - 1
server.go

@@ -107,7 +107,7 @@ func respondWithImage(r *http.Request, rw http.ResponseWriter, data []byte, imgU
 	gzipped := strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") && conf.GZipCompression > 0
 
 	rw.Header().Set("Expires", time.Now().Add(time.Second*time.Duration(conf.TTL)).Format(http.TimeFormat))
-	rw.Header().Set("Cache-Control", fmt.Sprintf("Cache-Control: max-age=%d", conf.TTL))
+	rw.Header().Set("Cache-Control", fmt.Sprintf("max-age=%d, public", conf.TTL))
 	rw.Header().Set("Content-Type", mimes[po.format])
 	if gzipped {
 		rw.Header().Set("Content-Encoding", "gzip")