Re: [squid-users] Caching Content-Length:0 requests

From: Withnail <withnail@dont-contact.us>
Date: Mon, 24 Sep 2001 16:23:48 +0800

>

> Withnail wrote:
>
>> Hi,
>>
>> I seem to be having a few problems with squid in its current
>> incarnation. One of the main web users in our platform is a bespoke
>> application. All of the requests it makes has 'Content-Length: 0' set
>> in the HTTP headers, and this caused squid to request the content
>> directly every time. I don't have the option to change the program
>> generating the request.

[snip]

>> Any ideas how to make squid ignore this and cache properly for these
>> requests ?
> I don't see why it should bypass the cache on such requests. I don't
> think it is intentional.
>
> Some older Squid versions did not accept any Content-Length header on
> GET. Nowdays Squid accepts "Content-Length: 0" due to the amount of
> buggy user agents sending these bogus headers..

Sorry. I should have clarified. I have tried this on the latest versions

   squid-2.4.STABLE2
   squid-head-200109192301

I tested via the broken app, and directly using telnet like below...

localhost% cat request
GET http://www.mywebserver.com/abc/def/news_en_s.html HTTP/1.0
Referer: http://www.mywebserver.com/
host: www.mywebserver.com:80
Accept-Language: en-gb,en;q=0.5
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Connection: close
Accept: */*
Accept-Encoding: gzip, deflate
Content-Length: 0

localhost% telnet www.mywebserver.com 80 < request

Squid is transparently caching - it always goes direct if the C-L:0 line is in. If I remove it everything works fine.

>> At present, I have had to put a bodge into
>> clientReadRequest to delete the HDR_CONTENT_LENGTH header.

Is there a better way of fixing this right now than my code hack in client_side.c ?

thanks

Paul
Received on Mon Sep 24 2001 - 02:23:51 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:02:28 MST