[squid-users] why get a miss?

2008-09-27 Thread Jeff Peng
Hello,


I'm running Squid-3.0.9, when try to cache a page with a "?", I always
get a MISS. The server's response headers are:

(Status-Line)   HTTP/1.0 200 OK
Connection  close
Content-Encodinggzip
Content-Typetext/html; charset=gbk
DateSat, 27 Sep 2008 11:43:50 GMT
Server  Apache/2.0.54 (Unix) PHP/5.2.6
VaryAccept-Encoding
Via 1.0 cache.mysite.org (Squid/3.0.9)
X-Cache MISS from cache.mysite.org
X-Powered-ByPHP/5.2.6


I have commented out these two lines in squid.conf:

#hierarchy_stoplist cgi-bin ?
#refresh_pattern (cgi-bin|\?)0   0%  0


But why squid still get TCP_MISS in the response? Thanks.


Re: [squid-users] why get a miss?

2008-09-27 Thread Amos Jeffries
Jeff Peng wrote:
> Hello,
> 
> 
> I'm running Squid-3.0.9, when try to cache a page with a "?", I always
> get a MISS. The server's response headers are:
> 
> (Status-Line) HTTP/1.0 200 OK
> Connectionclose
> Content-Encoding  gzip
> Content-Type  text/html; charset=gbk
> Date  Sat, 27 Sep 2008 11:43:50 GMT
> ServerApache/2.0.54 (Unix) PHP/5.2.6
> Vary  Accept-Encoding
> Via   1.0 cache.mysite.org (Squid/3.0.9)
> X-Cache   MISS from cache.mysite.org
> X-Powered-By  PHP/5.2.6
> 
> 
> I have commented out these two lines in squid.conf:
> 
> #hierarchy_stoplist cgi-bin ?
> #refresh_pattern (cgi-bin|\?)0   0%  0

That last one is not about caching. Only about detecting when an object
is expected to be stale once already in cache. It's needed to maintain
safety and protect against dynamic pages being stored when they should not.

The request headers you show have no Expires: header and no age
information at all. They are thus very unsafe to cache.

It looks like you have control over the website. Adjust the PHP to send
Expires: or Cache-Control: max-age=N  information.

If that info is set properly and still not caching. We'll have to see
the rest of your config to tell why not.

Amos
-- 
Please use Squid 2.7.STABLE4 or 3.0.STABLE9