Re: [squid-users] [Help] Reverse Proxy: suspend bulk requests for invalid urls

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 13 May 2011 16:13:47 +1200

On 13/05/11 15:55, Le Trung Kien wrote:
> Hi,
> On the original servers, I'm using IIS6.0 and the 404b.html is the
> page returned when client requests non-existing pages.
> I attempt to add a header like this on that page:
>
> <HEAD><TITLE>The page cannot be found</TITLE>
> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
> <META HTTP-EQUIV="Cache-Control" Content="Private">
> <META HTTP-EQUIV="Expires" Content="300">
> </HEAD>
>
> This header is the same on all pages generated by our web applications
> and could be cached.
> However, I test and see that our squid still doesn't cache that 404b.html page
>
> squidclient -m HEAD http://invalid_URL
>
> HTTP/1.0 404 Not Found
> Content-Length: 1731
> Content-Type: text/html
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> Date: Fri, 13 May 2011 03:41:10 GMT
> X-Cache: MISS
>
> squidclient -m HEAD http://existing_URL
>
> HTTP/1.0 200 OK
> Date: Fri, 13 May 2011 03:34:22 GMT
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> X-AspNet-Version: 2.0.50727
> X-Powered-By: UrlRewriter.NET 2.0.0
> Cache-Control: private
> Content-Type: text/html; charset=utf-8
> Content-Length: 121485
> Age: 424
> X-Cache: HIT
>
> I realize that the header squidclient receives when requesting an
> invalid URL is less and our squid still MISS.
>
> Kien Le.
>

That is HTML. The page headers only affect the web browser graphical
display.

You need to set them in the HTTP headers instead. So Expires: shows up
in your HEAD request. IIRC there is an XML site-wide config file
somewhere (in the site root directory?) where these are set. I'm a bit
vague on the details though, not being an IIS admin.

Also,
  Content-Type does not matter IIS is sending it anyway as you can see
below.
  "Cache-Control: private" will absolutely prevent Squid from caching
the reply. The exact opposite of what you are trying to do. If you have
private/confidential user details on that 404 they will have to be removed.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.12
   Beta testers wanted for 3.2.0.7 and 3.1.12.1
Received on Fri May 13 2011 - 04:13:54 MDT

This archive was generated by hypermail 2.2.0 : Fri May 13 2011 - 12:00:03 MDT