Re: [squid-users] Squid reverse proxy with cache.

From: Morgan Storey <me_at_morganstorey.com>
Date: Tue, 12 Apr 2011 15:17:34 +1000

Thanks for that suggestion George (remove stale-while-revalidate from
the HTTP headers), still doesn't work.
Some background for those who may have missed my original post, trying
to do a reverse proxy on windows to IIS(on a different box) as a proof
of concept Squid based web accelerator. I need it to cache the page
and serve it from the cache when the IIS server innevitably crashes.
In testing so far it works as a proxy (the site comes up if the
backend IIS is up and running) and it appears to be caching something
as the cache folder is a little bit larger, but if I down the IIS box
I just get the usual:
While trying to retrieve the URL: http://www.site.com/

The following error was encountered:

Connection to myAccel Failed
The system returned:

    (10061) WSAECONNREFUSED, Connection refused.

*Headers below:

HTTP/1.1 200 OK
Connection: keep-alive
Date: Tue, 12 Apr 2011 04:48:23 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Cache-Control: public, max-age=5, stale-if-error=36000
Set-Cookie: ASP.NET_SessionId=fdlkjayuf98dsfgnkjdsl7; path=/; HttpOnly
Cache-Control: private

*cache.log below (this is taken from getting the site successfully and
then shutting down the IIS server, the last entry is once it was
shutdown):
1302584741.386 RELEASE -1 FFFFFFFF 2E9D6462F2716951751295ED14C942BC
200 1302584741 -1 1302584746 text/html 15234/15234 GET
http://www.site.com/
1302584741.402 RELEASE -1 FFFFFFFF 38319285BCC393CA970F23AB9FEE15F9
304 1300777504 1277772533 -1 text/css -1/0 GET
http://www.site.com/css/main.css
1302584741.402 RELEASE -1 FFFFFFFF F3C30505B081CC83928FBC7BAB0523DF
304 1300777504 1223514403 -1 text/css -1/0 GET
http://www.site.com/css/UserStyles.css
1302584741.402 RELEASE -1 FFFFFFFF 08F6080055C4EBF1AFF2264CE8F10E96
304 1300777504 1180055942 -1 application/octet-stream -1/0 GET
http://www.site.com/js/schedule.js
1302584741.417 RELEASE -1 FFFFFFFF 2D9556BA364CB7ABC95365E7C248C7CB
304 1300777509 1198571122 -1 application/octet-stream -1/0 GET
http://www.site.com/js/ie-hover-menu.js
1302584741.433 RELEASE -1 FFFFFFFF 1E16788CD3EBD32EC6F46B223D6080DC
304 1300777509 1218696350 -1 application/octet-stream -1/0 GET
http://www.site.com/js/jquery-1.2.6.pack.js
1302584741.495 RELEASE -1 FFFFFFFF 936685916031E6D503C920DDF50B0430
304 1300777512 1237263315 -1 image/jpeg -1/0 GET
http://www.site.com/images/banner4.jpg
1302584741.495 RELEASE -1 FFFFFFFF 4C75A7F61D024EB6932A609ADED460FA
304 1300777512 1237255731 -1 image/jpeg -1/0 GET
http://www.site.com/images/banner7.jpg
1302584741.495 RELEASE -1 FFFFFFFF 0892940B9624EB143897D94D2B40EC5F
304 1300777512 1232505274 -1 image/jpeg -1/0 GET
http://www.site.com/images/banner8.jpg
1302584741.495 RELEASE -1 FFFFFFFF 4B5B2A9477E763687847C188DF165ED9
304 1300777512 1237263342 -1 image/jpeg -1/0 GET
http://www.site.com/images/banner9.jpg
1302584741.495 RELEASE -1 FFFFFFFF CD57E02061DE59BDF617A9EF67C2B49E
304 1300777512 1237335747 -1 image/jpeg -1/0 GET
http://www.site.com/images/banner10.jpg
1302584741.495 RELEASE -1 FFFFFFFF 3DDF5F054B443D55E272A7C54470A233
304 1300777512 1237442743 -1 image/jpeg -1/0 GET
http://www.site.com/images/banner11.jpg
1302584741.511 RELEASE -1 FFFFFFFF CDB6DBC564419727DF65BBB20387C4CE
304 1300777512 1237442754 -1 image/jpeg -1/0 GET
http://www.site.com/images/banner12.jpg
1302584741.511 RELEASE -1 FFFFFFFF 773B55C189D3BFB0BB50303F21A01673
304 1302584542 1287994239 1334120542 application/x-javascript -1/0 GET
http://www.site.com/WebResource.axd?d=Za3tEhKgq0WlmeH-MRZDc-05ZUDFgsK27Qt9ORh8XEw-tAGTkvBwa4Ix2HOJF610x0_LQzeBBuqVzX9SdAzRUlaMPMo1&t=634236306395379416
1302584741.527 RELEASE -1 FFFFFFFF 8F43386B199A0997027B63507E792C1F
304 1302584741 1197433705 1302584746 unknown -1/0 GET
http://www.site.com/ScriptResource.axd?d=-WeS7Ni_cpoy7FITr1-hmJ7GUobezovWFnsB-l_lR_VfqHGpDzKa1hyI_sLwaAxA4DkUY7sCnYPzHPm0oMVQuvmXkplX2Qaz_LsS4zc96TnlFEwgygyaSUEWjsMX20HM9KK5_NoNa4cw2xGuXk_c0cYqtYjl971j3UNUCC_DFo05kdnd0&t=633330701051406250
1302584741.589 RELEASE -1 FFFFFFFF AAE33DD772F9980DA027DBDE9091BD26
304 1302584741 1197433705 1302584746 unknown -1/0 GET
http://www.site.com/ScriptResource.axd?d=bmWrmFXsuE3Ize8XrUf5BUB8mNhBRld29LTdYhEXzOyF733V9C9hqPfGWmYx-IdOX1TTt01YsCDVXkdG0VWcyfxVOxPDF1yS8LFgEWjTdk3n0TQsYHvUdTnhZGoYey8LLXvVSp5VFqL_IpDCAyVqt4yDoh4sfGyuX9PJxtrEJdhWDeX90&t=633330701051406250
1302584741.620 RELEASE -1 FFFFFFFF 84CD816AD473BE5C63EEDA225D6A4069
304 1300777516 1232507766 -1 image/gif -1/0 GET
http://www.site.com/images/logo.gif
1302584741.620 RELEASE -1 FFFFFFFF 7D28A05DC2EE49E4053160E9DF8CB5E0
304 1300777516 1222835419 -1 image/gif -1/0 GET
http://www.site.com/images/dot.gif
1302584741.620 RELEASE -1 FFFFFFFF AC84A51E9ECC15BA6D6050B9FE78356D
304 1300777516 1254887379 -1 image/jpeg -1/0 GET
http://www.site.com/media/29636/websterlogo_60x51.jpg
1302584741.620 RELEASE -1 FFFFFFFF 15DDD148B8754254A9F3CB8D3C7DC517
304 1300777516 1198457124 -1 image/jpeg -1/0 GET
http://www.site.com/images/header_bg.jpg
1302584741.620 RELEASE -1 FFFFFFFF AD51FA87EB5FDCF8E071956D81CDD11B
304 1300777516 1198457170 -1 image/jpeg -1/0 GET
http://www.site.com/images/header_line.jpg
1302584741.620 RELEASE -1 FFFFFFFF 7C25FABD5643D34F2943AE6A7A059F86
304 1300777516 1198464562 -1 image/jpeg -1/0 GET
http://www.site.com/images/button_search_bg.jpg
1302584741.620 RELEASE -1 FFFFFFFF 941F2A4A4654092BDA31DEB56D617096
304 1300777516 1198457394 -1 image/jpeg -1/0 GET
http://www.site.com/images/menu_line.jpg
1302584741.620 RELEASE -1 FFFFFFFF 5D6D076FEBD132933CE88F21EAAD56D0
304 1300777516 1198467380 -1 image/gif -1/0 GET
http://www.site.com/images/arrow_blue_left.gif
1302584741.620 RELEASE -1 FFFFFFFF 65F14B426865BF5D1832516BC52687FA
403 1302584741 -1 -1 text/html 1138/1138 GET
http://www.google-analytics.com/ga.js
1302584741.620 RELEASE -1 FFFFFFFF CAB8B6CF6D658842AA43E014AFD73432
304 1300777516 1198466744 -1 image/gif -1/0 GET
http://www.site.com/images/arrow_red_left.gif
1302584741.652 RELEASE -1 FFFFFFFF EF937ED0620D2770BD13D9D35397D95C
304 1300777512 1237263342 -1 image/jpeg -1/0 GET
http://www.site.com/images/banner9.jpg
1302584773.602 RELEASE -1 FFFFFFFF 127CB42EE6123BF72CD25618D185E296
504 1302584773 -1 -1 text/html 1135/1135 GET
http://www.site.com/

*squid.conf below:

dns_nameservers 10.10.10.16

cache_dir ufs d:/cache 8000 100 256
cache_mem 512 MB
maximum_object_size_in_memory 10240 KB

access_log d:/squidlogs/access.log squid
cache_log d:/squidlogs/cache.log
cache_store_log d:/squidlogs/store.log
logfile_rotate 10

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 443 # https
acl CONNECT method CONNECT

##############################################################

http_port 80 accel defaultsite=www.site.com vhost

cache_peer 10.10.10.18 parent 80 0 no-query originserver name=myAccel

acl our_sites dstdomain www.site.com
forwarded_for on

http_access allow our_sites
cache_peer_access myAccel allow our_sites
cache_peer_access myAccel deny all

cache_effective_group proxy
icp_access allow all

max_stale 1 week
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern -i (/umbraco/|\?) 0 0% 0
refresh_pattern . 120 20% 4320

acl QUERY urlpath_regex umbraco
acl POST method POST
no_cache deny QUERY
no_cache deny POST

forward_timeout 15 seconds
httpd_suppress_version_string on
header_access Cache-Control deny all
cache_mgr someone_at_somewhere.com
Received on Tue Apr 12 2011 - 05:17:44 MDT

This archive was generated by hypermail 2.2.0 : Tue Apr 12 2011 - 12:00:04 MDT