On 25-10-2012 14:49, Amos Jeffries wrote:
On 25/10/2012 7:24 p.m., Ben wrote:

Hi,

I upgraded my squid boxes from 3.1 series to 3.2 series. I noticed
that 3.2 is not better then 3.1 while concerning with caching
capabilities.

I checked for simple web site , which has jpg images and all. as web
site is standard and normal site. So squid must cache it contents. I
tried many times, but each time i saw TCP_MISS in access.log

I checked for a site which is elitecore.com ( as example )

redbot url: http://redbot.org/?descend=True&uri=http://elitecore.com -
it suggests that this site is cacheable.

squid version : 3.2.3

currently, there is no change in squid.conf. I  am using default one
for testing purposes.


what could be problem with squid-3.2.3? Is there any changes required
for 3.2.3 configuration or any changes in caching mechanism for 3.2
series?

Firstly, TCP_MISS does *not* mean anything about whether the response to
a previous request or to the curent request was cached. All it means is
the current request was not serviced by anything already existing in cache.

Both the client request headers AND the cached response headers are
taken into account when deciding whether a response can be served from
cache. It is perfectly reasonable to get a log trace like this from a
client requesting brand new object and rejecting anything that might be
stale (max-age=0).

Since the site uses User-Agent in its Vary: header it is perfectly
possible that each client request has a different agent string and
MISS'es the previously cached entry. Even one byte of change in the
agent string will cause those objects to MISS.
  But since you said 3.1 was working okay it is probably not this issue
which affects all caches.

For testing purpose, I open same site from same browser and again run same process to check caching is happening or not.



For more info on what 3.2.3 is caching you can log at debug level 11,3
and get log about each response and whether it was determined cacheable.
Look for "cacheableReply" and a YES/NO with explained reason.


I enabled debug_options 11,3. It shows request/response header with meaningfull information but I could not find "cacheableReply", mentioning one block of request/response from log as per 11,3 debug level.


---------
GET http://elitecore.com/images/body_bkgd.jpg HTTP/1.1^M
Host: elitecore.com^M
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1^M
Accept: image/png,image/*;q=0.8,*/*;q=0.5^M
Accept-Language: en-us,en;q=0.5^M
Accept-Encoding: gzip, deflate^M
Proxy-Connection: keep-alive^M
Referer: http://elitecore.com/css/stylesheet.css^M
Cookie: __utma=25544809.1437989579.1351159439.1351159439.1351159439.1; __utmb=25544809.4.10.1351159439; __utmc=25544809; __utmz=25544809.1351159439.1
.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)^M
If-Modified-Since: Thu, 24 Sep 2009 06:16:20 GMT^M
If-None-Match: "4005f-56a5-4744cc51a1500"^M
Cache-Control: max-age=0^M
^M

----------
2012/10/25 15:45:32.794 kid1| httpStart: "GET http://elitecore.com/images/body_bkgd.jpg"; 2012/10/25 15:45:32.794 kid1| HTTP Server local=10.115.1.230:30562 remote=180.179.100.102:80 FD 35 flags=1
2012/10/25 15:45:32.794 kid1| HTTP Server REQUEST:
---------
GET /images/body_bkgd.jpg HTTP/1.1^M
Host: elitecore.com^M
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1^M
Accept: image/png,image/*;q=0.8,*/*;q=0.5^M
Accept-Language: en-us,en;q=0.5^M
Accept-Encoding: gzip, deflate^M
Referer: http://elitecore.com/css/stylesheet.css^M
Cookie: __utma=25544809.1437989579.1351159439.1351159439.1351159439.1; __utmb=25544809.4.10.1351159439; __utmc=25544809; __utmz=25544809.1351159439.1
.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)^M
If-Modified-Since: Thu, 24 Sep 2009 06:16:20 GMT^M
If-None-Match: "4005f-56a5-4744cc51a1500"^M
Via: 1.1 ns1.example.com (squid/3.2.3)^M
X-Forwarded-For: 10.115.1.16^M
Cache-Control: max-age=0^M
Connection: keep-alive^M

As per my understanding, In request header,I can see Cache-Control: max-age=0 , so i add override-expire options with refresh_pattern to cross this header parameters but still same.

refresh_pattern is for response header ? or for both request/response?
I added refresh_pattern,

refresh_pattern -i \.(jpg|jpeg)$ 1440 40% 14400 override-expire
for testing purpose .

How to cache such site's contents?


BR
Ben




Amos


I tested same site with 3.1. series and it is working fine.

access.log :

1351098321.835     80 192.168.1.23 TCP_MISS/200 3414 GET
http://elitecore.com/ - HIER_DIRECT/180.179.100.102 text/html
1351098321.876     19 192.168.1.23 TCP_MISS/200 1280 GET
http://elitecore.com/css/stylesheet.css - HIER_DIRECT/180.179.100.102
text/css
1351098321.898     37 192.168.1.23 TCP_MISS/200 1352 GET
http://elitecore.com/js/menu.js - HIER_DIRECT/180.179.100.102
application/javascript
1351098321.899     21 192.168.1.23 TCP_MISS/200 421 GET
http://elitecore.com/images/aarow_bullet.gif -
HIER_DIRECT/180.179.100.102 image/gif
1351098321.913     52 192.168.1.23 TCP_MISS/200 3682 GET
http://elitecore.com/js/menuscript.js - HIER_DIRECT/180.179.100.102
application/javascript
1351098321.919     57 192.168.1.23 TCP_MISS/200 5755 GET
http://elitecore.com/images/header_curve.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098321.919     57 192.168.1.23 TCP_MISS/200 9629 GET
http://elitecore.com/images/elitecore_logo.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098321.922     22 192.168.1.23 TCP_MISS/200 1156 GET
http://elitecore.com/images/home-mod-bot.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098321.941      1 192.168.1.23 TCP_MEM_HIT/200 33122 GET
http://meltwaternews.com/magenta/xml/html/51/05/v2_374671.html -
HIER_NONE/- text/html
1351098321.973      1 192.168.1.23 TCP_MEM_HIT/200 57559 GET
http://meltwaternews.com/js/jquery_1.3.js - HIER_NONE/-
application/javascript
1351098322.019      0 192.168.1.23 TCP_MEM_HIT/200 906 GET
http://meltwaternews.com/ext/a3logics/APAC/Images/FBN-32333bg1.png -
HIER_NONE/- image/png
1351098322.145    247 192.168.1.23 TCP_MISS/200 5305 GET
http://elitecore.com/images/Telecommunication-icon.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098322.365    446 192.168.1.23 TCP_MISS/200 7354 GET
http://elitecore.com/images/AccessGateway-icon.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098322.575    662 192.168.1.23 TCP_MISS/200 6562 GET
http://elitecore.com/images/NetworkSecurity-icon.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098322.584    437 192.168.1.23 TCP_MISS/200 5460 GET
http://elitecore.com/images/menu_bkgd.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098322.865    498 192.168.1.23 TCP_MISS/200 5487 GET
http://elitecore.com/images/flyout_bkgd.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098323.379    514 192.168.1.23 TCP_MISS/200 5482 GET
http://elitecore.com/images/footer_bkgd.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098323.635   1710 192.168.1.23 TCP_MISS/200 5919 GET
http://elitecore.com/images/body_bkgd.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098324.097   2235 192.168.1.23 TCP_MISS/200 38616 GET
http://elitecore.com/images/home_banner_new.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098325.362   2786 192.168.1.23 TCP_MISS/200 441 GET
http://elitecore.com/images/home-mod-top-rep.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098325.765   3826 192.168.1.23 TCP_MISS/200 15368 GET
http://www.google-analytics.com/ga.js - HIER_DIRECT/173.194.36.36
text/javascript
1351098325.861   3276 192.168.1.23 TCP_MISS/200 518 GET
http://elitecore.com/images/homepage-mod-top2.jpg -
HIER_DIRECT/180.179.100.102 image/jpeg
1351098326.073   4153 192.168.1.23 TCP_MISS/200 46409 GET
http://elitecore.com/images/customers-new.gif -
HIER_DIRECT/180.179.100.102 image/gif
1351098326.676    865 192.168.1.23 TCP_MISS/200 432 GET
http://www.google-analytics.com/__utm.gif? - HIER_DIRECT/173.194.36.36
image/gif
1351098328.980   2291 192.168.1.23 TCP_MISS/200 21700 GET
http://elitecore.com/favicon.ico - HIER_DIRECT/180.179.100.102
image/x-icon


BR
Ben





Reply via email to