[squid-users] how to set up expires header in squid?

From: 老邪 <swansun95_at_gmail.com>
Date: Thu, 22 Apr 2010 12:28:05 +0800

hi, everyone
   i have a web server(apache 2.0.x) and a squid(2.6) in front of the
web as the reverse proxy.
in the web server, i have set up the mod_expires module to export the
Expires HTTP header as 1 year. and it works,
   when i visit the apache directly, here is the http header info
----------------------
[shell]# curl -D- -o /dev/null http://www.mydomain.com/test.png
HTTP/1.1 200 OK
Date: Fri, 09 Apr 2010 07:52:21 GMT
Server: Apache/2.0.53 (Unix) mod_perl/1.99_14 Perl/v5.8.5 PHP/5.0.3
mod_ssl/2.0.53 OpenSSL/0.9.7e mod_fastcgi/mod_fastcgi-SNAP-0404142202
Last-Modified: Thu, 06 Apr 2006 12:03:53 GMT
Accept-Ranges: bytes
Content-Length: 512
Cache-Control: max-age=31536000, public
Expires: Sat, 09 Apr 2011 07:52:21 GMT
Content-Type: image/png
-----------------------

     and then i put the squid in front of the web, set up the squid as
a reverse proxy. then i visit the
same URL again, then i got the different header
------------------
[shell]$ curl -D- -o /dev/null http://www.mydomain.com/test.png
HTTP/1.0 200 OK
Date: Fri, 09 Apr 2010 08:56:00 GMT
Server: Apache/2.0.53 (Unix) mod_perl/1.99_14 Perl/v5.8.5 PHP/5.0.3
mod_ssl/2.0.53 OpenSSL/0.9.7e mod_fastcgi/mod_fastcgi-SNAP-0404142202
Last-Modified: Thu, 06 Apr 2006 12:03:53 GMT
Accept-Ranges: bytes
Content-Length: 512
Content-Type: image/png
Age: 1025
X-Cache: HIT from squid.mydomain.com
Via: 1.0 squid.mydomain.com:80 (squid/2.6.STABLE23)
Connection: close
-----------------------

    the pic loads correctly, but as you can see, the "expires" header
is gone (compare with visit apache directly).
but i need to keep it.
    so, i'm wondering how to set up squid to export the "expires" header?
    i have tried use refresh_pattern, but no luck.. i totaly have no
idea now. so i have to look for help here.
    any tips are appreciated? thank you~~
Received on Thu Apr 22 2010 - 04:28:12 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 22 2010 - 12:00:05 MDT