[squid-users] cache-control

Thiago Farina tfransosi at gmail.com
Tue Oct 14 18:14:02 UTC 2014


Hi squiders,

We want to move the following Go code into squid, as we already have
squid in front of our Go server.

The code is:

func makeResourceHandler() func(http.ResponseWriter, *http.Request) {
  fileServer := http.FileServer(http.Dir("./"))
  return func(w http.ResponseWriter, r *http.Request) {
  w.Header().Add("Cache-Control", string(300))
    fileServer.ServeHTTP(w, r)
  }
}

and in the main() function we have:

http.HandleFunc("/res/", autogzip.HandleFunc(makeResourceHandler()))

The only thing close to this I found was 'header_access Cache-Control
allow all'.

What is the proper way to do this?

Thanks all (for reading) in advance, for any reply.

Any hint/point is appreciate.

Best regards,

-- 
Thiago Farina


More information about the squid-users mailing list