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

2010-04-22 Thread
hi, all
 that problem is resolved. it's due to there was a setting for
header_access , that discard the expires header.
 thanks!

On Thu, Apr 22, 2010 at 12:55 PM, 老邪  wrote:
> will try, thank you!!!
>
> will update here
>
> On Thu, Apr 22, 2010 at 12:36 PM, Jeff Pang  wrote:
>> On Thu, Apr 22, 2010 at 12:28 PM, 老邪  wrote:
>>
>>>the pic loads correctly, but as you can see,  the "expires" header
>>> is gone (compare with visit apache directly).
>>
>> Squid normally doesn't discard the output headers from original server.
>> max-age header should be there, like 126's:
>>
>> $ curl -D- -o /dev/null www.126.com
>> HTTP/1.0 200 OK
>> Date: Thu, 22 Apr 2010 04:17:04 GMT
>> Server: Apache
>> Accept-Ranges: bytes
>> Cache-Control: max-age=3600
>> Expires: Thu, 22 Apr 2010 05:17:04 GMT
>> Vary: Accept-Encoding
>> Content-Length: 26281
>> Content-Type: text/html; charset=GB2312
>> Age: 946
>> X-Cache: HIT from mcache.163.com
>> Connection: close
>>
>>
>> So you may both check your httpd.conf to see if mod_expire handle the
>> http 1.0 request correctly since squid forward the request with
>> http/1.0 protocal.
>>
>>
>> --
>> Jeff Pang
>> http://home.arcor.de/pangj/
>>
>


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

2010-04-21 Thread
will try, thank you!!!

will update here

On Thu, Apr 22, 2010 at 12:36 PM, Jeff Pang  wrote:
> On Thu, Apr 22, 2010 at 12:28 PM, 老邪  wrote:
>
>>    the pic loads correctly, but as you can see,  the "expires" header
>> is gone (compare with visit apache directly).
>
> Squid normally doesn't discard the output headers from original server.
> max-age header should be there, like 126's:
>
> $ curl -D- -o /dev/null www.126.com
> HTTP/1.0 200 OK
> Date: Thu, 22 Apr 2010 04:17:04 GMT
> Server: Apache
> Accept-Ranges: bytes
> Cache-Control: max-age=3600
> Expires: Thu, 22 Apr 2010 05:17:04 GMT
> Vary: Accept-Encoding
> Content-Length: 26281
> Content-Type: text/html; charset=GB2312
> Age: 946
> X-Cache: HIT from mcache.163.com
> Connection: close
>
>
> So you may both check your httpd.conf to see if mod_expire handle the
> http 1.0 request correctly since squid forward the request with
> http/1.0 protocal.
>
>
> --
> Jeff Pang
> http://home.arcor.de/pangj/
>


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

2010-04-21 Thread
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~~