[squid-users] cache-control

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


On Tue, Oct 14, 2014 at 3:34 PM, Amos Jeffries <squid3 at treenet.co.nz> wrote:
> -----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).
>
I think that is true. This res/ directory contains only css, html and js files.

-- 
Thiago Farina


More information about the squid-users mailing list