Skip to content

Commit

Permalink
Set cache-control max-age for cloudfront
Browse files Browse the repository at this point in the history
  • Loading branch information
jelinden committed Mar 17, 2015
1 parent 3795432 commit e41beef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
build
.goxc.local.json
*.test
imageproxy.iml
2 changes: 1 addition & 1 deletion cmd/imageproxy/main.go
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/gregjones/httpcache"
"github.com/gregjones/httpcache/diskcache"
"github.com/peterbourgon/diskv"
"willnorris.com/go/imageproxy"
"github.com/almamedia/imageproxy"
)

// goxc values
Expand Down
1 change: 1 addition & 0 deletions imageproxy.go
Expand Up @@ -125,6 +125,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {

copyHeader(w, resp, "Content-Length")
copyHeader(w, resp, "Content-Type")
w.Header().Set("Cache-Control", fmt.Sprintf("max-age=%d, public, must-revalidate, proxy-revalidate", 31557600))
io.Copy(w, resp.Body)
}

Expand Down

0 comments on commit e41beef

Please sign in to comment.