|
Thstart |
at Dec 14, 2012 at 5:51 pm
|
⇧ |
| |
I am using following code:
var webroot = flag.String("root", "/public", "web root directory")
func handler(w http.ResponseWriter, r *http.Request) {
...
}
http.Handle("/images/", http.StripPrefix("",
http.FileServer(http.Dir(*webroot))))
http.HandleFunc("/", handler)
http.ListenAndServe(listenAddr, nil)
What I need to set so the etag be computed for the static files in webroot?
On Friday, December 14, 2012 9:39:57 AM UTC-8, minux wrote:On Sat, Dec 15, 2012 at 1:37 AM, thstart <brag...@bragbuddy.com<javascript:>
wrote:
I want to use etags to reduce bandwidth - are there build in
etags in standard web server?
if your handle use http.ServeContent to serve content and set ETag in
header
before calling that, net/http will automatically handle some ETag related
stuff
for you (If-Non-Match, for example)
--