[squid-users] Squid 3.0 as reverse proxy

From: Sébastien WENSKE <sebastien_at_wenske.fr>
Date: Mon, 23 Nov 2009 15:26:35 +0100

Hi List,

I use a Squid Cache version 3.0.STABLE16 as reverse proxy on an 100Mb server (hosted by Iliad) to cache my web sites running on my home connection (1024Kb Max).

This configuration Works pretty fine, but I have troubles to cache some images (jpg|png) with a particular url:

For example, I have a photos gallery where the link to download the original picture (biggest size) has a "?" at the end:

http://gallery.wenske.fr/wallpapers/holland_dream_2560x1600.jpg.html?

In the access log I can see that this object is not cached:

23/Nov/2009:15:17:43 +0100.960 12372 84.207.23.135 TCP_MISS/200 1313021 GET http://gallery.wenske.fr/wallpapers/holland_dream_2560x1600.jpg.html? - DEFAULT_PARENT/sl01 image/jpeg

(store.log, may be helpful: 1258985863.960 RELEASE -1 FFFFFFFF B8B54D74210C1D0090AA8E1390D77D9C 200 1258985851 1258985851 375007920 image/jpeg -1/1312295 GET http://gallery.wenske.fr/wallpapers/holland_dream_2560x1600.jpg.html?)

I suppose that's due to this directive in the squid.conf:

hierarchy_stoplist cgi-bin ?

Is it possible to enable caching for this kind of url? Maybe with a regex?

Thanks for your help,

Sébastien WENSKE

------------------------------------- the complete squid.conf -------------------------------------

acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl all src
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 443 # https
acl CONNECT method CONNECT

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow all

icp_access allow localnet
icp_access deny all

htcp_access allow localnet
htcp_access deny all
http_port 88.191.97.6:80 accel vhost

acl dest_site dstdomain blog.canardwc.com gallery.wenske.fr verdin.canardwc.com
acl dest_addr dst 10.0.1.5
acl dest_port port 80

cache_peer 10.0.1.5 parent 80 0 name=sl01 no-query originserver default
cache_peer_access sl01 allow dest_site

http_access allow dest_addr dest_port

hierarchy_stoplist cgi-bin ?

cache_mem 1024 MB
maximum_object_size_in_memory 2048 KB
memory_replacement_policy lru

cache_replacement_policy lru
cache_dir ufs /var/cache/squid 2048 16 256
minimum_object_size 0 KB
maximum_object_size 64096 KB

logformat squid %tl.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %un %Sh/%<A %mt
access_log /var/log/squid/reverse-proxy_access.log squid
cache_log /var/log/squid/reverse-proxy_cache.log
cache_store_log /var/log/squid/reverse-proxy_store.log
pid_filename /var/run/reverse-proxy.pid

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern (cgi-bin|\?) 0 0% 0
refresh_pattern . 0 20% 4320

visible_hostname sl03.wenske.local
cache_mgr xxxxxxxxxxxxxxxxx
#icp_port 3130
coredump_dir /var/cache
--------------------------------------------------------------------------------------------
Received on Mon Nov 23 2009 - 14:26:47 MST

This archive was generated by hypermail 2.2.0 : Mon Nov 23 2009 - 12:00:04 MST