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

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 12 Apr 2011 17:56:41 +1200

On 12/04/11 17:17, Morgan Storey wrote:
> 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/
>

There is no mystery here. I've stated the reason earlier.

> 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

The headers are concatenated and processed first-to-last.

"Cache-Control: private" being last on that list overrides
"Cache-Control: public" earlier on.

"Private" replies cannot be cached and that object will be discarded on
completion of its fetch.

As you can see from the snippet of store.log RELEASE, RELEASE, RELEASE
... of all those CSS, JS, GIF and JPEG objects which have no sensible
reason to be dropped.

SOLUTION:
   find the part of IIS or the web scripts which is adding that
"private" and turn it off.

>
> *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
<snip>

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.12
   Beta testers wanted for 3.2.0.6
Received on Tue Apr 12 2011 - 05:56:46 MDT

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