[squid-users] reload_into_ims - a possible bug

From: Martin Marji Cermak <[email protected]>
Date: Wed, 15 Dec 2004 18:48:37 +0800

Hello Guys,
I found probably a bug related to reload_into_ims directive.
I just found this topic interesting so I am posting it FYI.

I set it on for out of curiosity because I was wondering whether there
would be any problems.
According to the explanation in Duane Wessels book, it should just add
"If-Modified-Since" header to requests that contain a no-cache directive.
It really works as explained, with an exception - see below.

With reload_into_ims on, when the requested URL is forbidden (code 403)
and I press Shift-Reload in my Firefox 1.0, Squid does not make any
connection to the WWW server, but returns TCP_NEGATIVE_HIT!

IMHO, this is wrong. I liked the idea of adding If-Modified-Since header
- it is very clever. You can see a request in the WWW server log (so
Web developers are still happy) and Squid downloads the URL again only
when it has changed since Squid downloaded it last time.

I realised this when trying to download an mp3 file from my server. I
got 403 Forbidden response because the file had 600 attributes, so I
changed it to 644, hit shift-reload and I got 403 again!

The conclusion is as follow:
- with reload_into_ims OFF
   if I get 403 Forbidden (TCP_MISS/403) and hit SHIFT-reload button,
Squid contacts the WWW server again and I get
TCP_CLIENT_REFRESH_MISS/403. When I correct the problem at the WWW
server and hit SHIFT-reload, I get the correct page -
TCP_CLIENT_REFRESH_MISS/200

- with reload_into_ims ON
   if I get 403 Forbidden (TCP_MISS/403) and hit SHIFT-reload button,
Squid DOES NOT contact the WWW server again and I get
TCP_NEGATIVE_HIT/403. So I can correct the problem at the WWW server,
but still getting TCP_NEGATIVE_HIT/403 - no connection to the server.
(It starts working after several minutes, Squid forgets the negative hit
and then the reload works).

I guess this is a bug. Should I report it?
I have squid 2.5.STABLE7.

Best regards, Marji

PS1: I don't really need this feature, I just think it is a bug and
believe some people will be interested in this problem.

PS2: Reload without Shift sent different headers ("Cache-Control:
max-age=0", with Shift it is "Cache-Control: no-cache") so you get
TCP_NEGATIVE_HIT/403 regardless on with reload_into_ims settings.

PS3: there is a line from my access.log - the SHIFT-Reload with
reload_into_ims ON

touch test.html
chmod 600 test.html

1103105446.449 9 127.0.0.1 TCP_NEGATIVE_HIT/403 544 GET
http://bogus.net//test.html - NONE/- text/html
[Host: bogus.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)
Gecko/20041107 Firefox/1.0
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
]
[HTTP/1.1 403 Forbidden
Date: Wed, 15 Dec 2004 10:10:11 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux DAV/1.0.3 mod_ssl/2.8.9
OpenSSL/0.9.6c CSacek/2.1.9 PHP/4.1.2
Connection: close
Content-Type: text/html; charset=iso-88
Received on Wed Dec 15 2004 - 03:48:13 MST

This archive was generated by hypermail pre-2.1.9 : Sat Jan 01 2005 - 12:00:02 MST