[squid-users] cache-control

Amos Jeffries squid3 at treenet.co.nz
Tue Oct 14 18:34:25 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15/10/2014 7:14 a.m., Thiago Farina wrote:
> 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?

Perhapse you could explain what the code does?

If I'm reading that right these are web server actions performed on
the origin resource (adding resource lifetime control header, and gzip
content encoding).

Squid however is a proxy which operates *using* the message
representation and headers which are produced by that code.

Amos

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQEcBAEBAgAGBQJUPWywAAoJELJo5wb/XPRjSRUIAOQN9/crBxFSApRDjDvKKqsH
0+4Bp9ty7rT854wWXCA2bKYyxnyXm3oTQ/toNji4tP930Bx8OWufqrVEQ8vVI0lw
MAqD7odM3GhoopKfAlBoPeSY/z9cdiA4aAX+t653iZ/VGxktWBbpD4bXpUiQ0mGF
eh+UpJ6wFyhFvim3UFSvkPgnoE8Wj41LRZsb5WaHEQe7boj1njrmGpkWBIGIHL4m
mkpVLol4ZFf7uXP2BN6xSu400yUv2Xtw8SQv7ydOeflKThipKzv0UaYwc7T+IOzx
ymYMevumO9CwfMb5FJVnwmAgQKKYpQGQucJXuYLq239E2j4KJ6v56LNRU9bIlbQ=
=C8+D
-----END PGP SIGNATURE-----


More information about the squid-users mailing list