Varnish computes Content-Length and set it to 0 for one of my URL!
zabrane Mikael
zabrane3 at gmail.com
Fri Aug 6 17:43:03 CEST 2010
Hi Michael,
>> Notice that for scenario 3.2, Squid replies with HTTP/1.0 (as
>> requested by "curl -0").
>> For scenario 3.3, Varnish reply with HTTP/1.1.
>
> I don't think is likely to be relevant
I agree on that.
> and merely indicates that
> squid doesn't support HTTP/1.1.
>
> RFC 2145:
>
> An HTTP server SHOULD send a response version equal to the
> highest version for which the server is at least conditionally
> compliant, and whose major version is less than or equal to the
> one received in the request.
> and RFC 2616:
>
> Due to interoperability problems with HTTP/1.0 proxies discovered
> since the publication of RFC 2068, caching proxies MUST, [...]
> upgrade the request to the highest version they support.
Thanks for this pointer.
> Squid's HTTP/1.0 response suggests that it doesn't support HTTP 1.1.
Again, you're also right on that:
$ curl -1 -D - -v -I --no-keepalive --proxy 127.0.0.1:3128
http://www.groupama.fr/
Date: Fri, 06 Aug 2010 14:34:49 GMT
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Set-Cookie: jsessionid=McdJcjTszTRJZtf4jQVLR7RH2Z19ny2D2JSsqj04G2vKZYmjTQbj!204719863;
path=/
X-Cache: MISS from localhost
X-Cache-Lookup: MISS from localhost:3128
Via: 1.0 localhost (squid/3.0.STABLE8)
Proxy-Connection: keep-alive
[...]
> Have you examined the response from your caching backend and
> compared it to the direct response, or the response from squid?
As I wrote it before, accessing our backend directly with "curl" or
any web browser
worked for us for years now. Here's an example:
$ curl -0 -D - -v -I --no-keepalive --proxy 127.0.0.1:7676
http://www.groupama.fr/
Date Tue, 15 Jun 2010 09:18:29 GMT
Content-Type text/html; charset=UTF-8
X-Powered-By ASP.NET
Set-Cookie jsessionid=MXFJmqLZ2cwnR1gyFhVDvzG59zx2KcP2vKcg6lNP4Gnz5nVky4D1!1556069365;
path=/
[...]
> It seems like Varnish is only adding the erroneous header when it is
> using your "caching backend", yes? (i.e. the thing on port 7676)
Yep, only with our backend.
> Would capturing the traffic Varnish sees with tcpdump and comparing
> the two (squid and the caching backend) be feasible?
with wireshark, it's my first time using it (please, see enclosed files).
> Does Varnish also have this behaviour if it fetches the data
> straight from the source server, or is it only present if it fetches
> it via the caching backend?
A bit complicated to explain, but there no "source server" in reality.
Varnish can only fetch data from our "caching server" or from "squid"
(if no special HTTP
header is included in the request).
Thanks again.
--
Regards
Zabrane
-------------- next part --------------
No. Time Source Destination Protocol Info
1 0.000000 127.0.0.1 127.0.0.1 TCP 43882 > ndl-aas [SYN] Seq=0 Win=32792 Len=0 MSS=16396 TSV=6247556 TSER=0 WS=6
Frame 1 (76 bytes on wire, 76 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 43882 (43882), Dst Port: ndl-aas (3128), Seq: 0, Len: 0
No. Time Source Destination Protocol Info
2 0.000048 127.0.0.1 127.0.0.1 TCP ndl-aas > 43882 [SYN, ACK] Seq=0 Ack=1 Win=32768 Len=0 MSS=16396 TSV=6247556 TSER=6247556 WS=6
Frame 2 (76 bytes on wire, 76 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: ndl-aas (3128), Dst Port: 43882 (43882), Seq: 0, Ack: 1, Len: 0
No. Time Source Destination Protocol Info
3 0.000069 127.0.0.1 127.0.0.1 TCP 43882 > ndl-aas [ACK] Seq=1 Ack=1 Win=32832 Len=0 TSV=6247556 TSER=6247556
Frame 3 (68 bytes on wire, 68 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 43882 (43882), Dst Port: ndl-aas (3128), Seq: 1, Ack: 1, Len: 0
No. Time Source Destination Protocol Info
4 0.000368 127.0.0.1 127.0.0.1 HTTP HEAD http://www.groupama.fr/ HTTP/1.1
Frame 4 (293 bytes on wire, 293 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 43882 (43882), Dst Port: ndl-aas (3128), Seq: 1, Ack: 1, Len: 225
Hypertext Transfer Protocol
No. Time Source Destination Protocol Info
5 0.000392 127.0.0.1 127.0.0.1 TCP ndl-aas > 43882 [ACK] Seq=1 Ack=226 Win=33856 Len=0 TSV=6247556 TSER=6247556
Frame 5 (68 bytes on wire, 68 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: ndl-aas (3128), Dst Port: 43882 (43882), Seq: 1, Ack: 226, Len: 0
No. Time Source Destination Protocol Info
6 1.769455 127.0.0.1 127.0.0.1 HTTP HTTP/1.0 200 OK
Frame 6 (451 bytes on wire, 451 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: ndl-aas (3128), Dst Port: 43882 (43882), Seq: 1, Ack: 226, Len: 383
Hypertext Transfer Protocol
No. Time Source Destination Protocol Info
7 1.769490 127.0.0.1 127.0.0.1 TCP 43882 > ndl-aas [ACK] Seq=226 Ack=384 Win=33920 Len=0 TSV=6247998 TSER=6247998
Frame 7 (68 bytes on wire, 68 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 43882 (43882), Dst Port: ndl-aas (3128), Seq: 226, Ack: 384, Len: 0
No. Time Source Destination Protocol Info
8 1.770082 127.0.0.1 127.0.0.1 TCP 43882 > ndl-aas [FIN, ACK] Seq=226 Ack=384 Win=33920 Len=0 TSV=6247999 TSER=6247998
Frame 8 (68 bytes on wire, 68 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 43882 (43882), Dst Port: ndl-aas (3128), Seq: 226, Ack: 384, Len: 0
No. Time Source Destination Protocol Info
9 1.770157 127.0.0.1 127.0.0.1 TCP ndl-aas > 43882 [FIN, ACK] Seq=384 Ack=227 Win=33856 Len=0 TSV=6247999 TSER=6247999
Frame 9 (68 bytes on wire, 68 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: ndl-aas (3128), Dst Port: 43882 (43882), Seq: 384, Ack: 227, Len: 0
No. Time Source Destination Protocol Info
10 1.770180 127.0.0.1 127.0.0.1 TCP 43882 > ndl-aas [ACK] Seq=227 Ack=385 Win=33920 Len=0 TSV=6247999 TSER=6247999
Frame 10 (68 bytes on wire, 68 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 43882 (43882), Dst Port: ndl-aas (3128), Seq: 227, Ack: 385, Len: 0
-------------- next part --------------
No. Time Source Destination Protocol Info
1 0.000000 127.0.0.1 127.0.0.1 TCP 41781 > http-alt [SYN] Seq=0 Win=32792 Len=0 MSS=16396 TSV=6371041 TSER=0 WS=6
Frame 1 (76 bytes on wire, 76 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 41781 (41781), Dst Port: http-alt (8008), Seq: 0, Len: 0
Source port: 41781 (41781)
Destination port: http-alt (8008)
Sequence number: 0 (relative sequence number)
Header length: 40 bytes
Flags: 0x02 (SYN)
Window size: 32792
Checksum: 0x3842 [correct]
Options: (20 bytes)
Maximum segment size: 16396 bytes
SACK permitted
Timestamps: TSval 6371041, TSecr 0
NOP
Window scale: 6 (multiply by 64)
No. Time Source Destination Protocol Info
2 0.000042 127.0.0.1 127.0.0.1 TCP http-alt > 41781 [SYN, ACK] Seq=0 Ack=1 Win=32768 Len=0 MSS=16396 TSV=6371041 TSER=6371041 WS=6
Frame 2 (76 bytes on wire, 76 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: http-alt (8008), Dst Port: 41781 (41781), Seq: 0, Ack: 1, Len: 0
Source port: http-alt (8008)
Destination port: 41781 (41781)
Sequence number: 0 (relative sequence number)
Acknowledgement number: 1 (relative ack number)
Header length: 40 bytes
Flags: 0x12 (SYN, ACK)
Window size: 32768
Checksum: 0x05c7 [correct]
Options: (20 bytes)
Maximum segment size: 16396 bytes
SACK permitted
Timestamps: TSval 6371041, TSecr 6371041
NOP
Window scale: 6 (multiply by 64)
[SEQ/ACK analysis]
No. Time Source Destination Protocol Info
3 0.000063 127.0.0.1 127.0.0.1 TCP 41781 > http-alt [ACK] Seq=1 Ack=1 Win=32832 Len=0 TSV=6371041 TSER=6371041
Frame 3 (68 bytes on wire, 68 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 41781 (41781), Dst Port: http-alt (8008), Seq: 1, Ack: 1, Len: 0
Source port: 41781 (41781)
Destination port: http-alt (8008)
Sequence number: 1 (relative sequence number)
Acknowledgement number: 1 (relative ack number)
Header length: 32 bytes
Flags: 0x10 (ACK)
Window size: 32832 (scaled)
Checksum: 0xece9 [correct]
Options: (12 bytes)
NOP
NOP
Timestamps: TSval 6371041, TSecr 6371041
[SEQ/ACK analysis]
No. Time Source Destination Protocol Info
4 0.000132 127.0.0.1 127.0.0.1 TCP 41781 > http-alt [PSH, ACK] Seq=1 Ack=1 Win=32832 [TCP CHECKSUM INCORRECT] Len=732 TSV=6371041 TSER=6371041
Frame 4 (800 bytes on wire, 800 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: 41781 (41781), Dst Port: http-alt (8008), Seq: 1, Ack: 1, Len: 732
Source port: 41781 (41781)
Destination port: http-alt (8008)
Sequence number: 1 (relative sequence number)
[Next sequence number: 733 (relative sequence number)]
Acknowledgement number: 1 (relative ack number)
Header length: 32 bytes
Flags: 0x18 (PSH, ACK)
Window size: 32832 (scaled)
Checksum: 0x0105 [incorrect, should be 0x4b6f (maybe caused by "TCP checksum offload"?)]
Options: (12 bytes)
NOP
NOP
Timestamps: TSval 6371041, TSecr 6371041
Data (732 bytes)
0000 47 45 54 20 68 74 74 70 3a 2f 2f 77 77 77 2e 67 GET http://www.g
0010 72 6f 75 70 61 6d 61 2e 66 72 2f 20 48 54 54 50 roupama.fr/ HTTP
0020 2f 31 2e 30 0d 0a 48 6f 73 74 3a 20 77 77 77 2e /1.0..Host: www.
0030 67 72 6f 75 70 61 6d 61 2e 66 72 0d 0a 55 73 65 groupama.fr..Use
0040 72 2d 41 67 65 6e 74 3a 20 4d 6f 7a 69 6c 6c 61 r-Agent: Mozilla
0050 2f 35 2e 30 20 28 58 31 31 3b 20 55 3b 20 4c 69 /5.0 (X11; U; Li
0060 6e 75 78 20 69 36 38 36 3b 20 66 72 3b 20 72 76 nux i686; fr; rv
0070 3a 31 2e 39 2e 31 2e 31 31 29 20 47 65 63 6b 6f :1.9.1.11) Gecko
0080 2f 32 30 31 30 30 37 30 31 20 46 69 72 65 66 6f /20100701 Firefo
0090 78 2f 33 2e 35 2e 31 31 0d 0a 41 63 63 65 70 74 x/3.5.11..Accept
00a0 3a 20 74 65 78 74 2f 68 74 6d 6c 2c 61 70 70 6c : text/html,appl
00b0 69 63 61 74 69 6f 6e 2f 78 68 74 6d 6c 2b 78 6d ication/xhtml+xm
00c0 6c 2c 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 6d l,application/xm
00d0 6c 3b 71 3d 30 2e 39 2c 2a 2f 2a 3b 71 3d 30 2e l;q=0.9,*/*;q=0.
00e0 38 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 8..Accept-Langua
00f0 67 65 3a 20 66 72 2c 66 72 2d 66 72 3b 71 3d 30 ge: fr,fr-fr;q=0
0100 2e 38 2c 65 6e 2d 75 73 3b 71 3d 30 2e 35 2c 65 .8,en-us;q=0.5,e
0110 6e 3b 71 3d 30 2e 33 0d 0a 41 63 63 65 70 74 2d n;q=0.3..Accept-
0120 45 6e 63 6f 64 69 6e 67 3a 20 67 7a 69 70 2c 64 Encoding: gzip,d
0130 65 66 6c 61 74 65 0d 0a 41 63 63 65 70 74 2d 43 eflate..Accept-C
0140 68 61 72 73 65 74 3a 20 49 53 4f 2d 38 38 35 39 harset: ISO-8859
0150 2d 31 2c 75 74 66 2d 38 3b 71 3d 30 2e 37 2c 2a -1,utf-8;q=0.7,*
0160 3b 71 3d 30 2e 37 0d 0a 43 6f 6e 6e 65 63 74 69 ;q=0.7..Connecti
0170 6f 6e 3a 20 63 6c 6f 73 65 0d 0a 50 72 6f 78 79 on: close..Proxy
0180 2d 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 63 6c 6f -Connection: clo
[...]
02d0 6e 6f 2d 63 61 63 68 65 0d 0a 0d 0a no-cache....
Data: 47455420687474703A2F2F7777772E67726F7570616D612E...
No. Time Source Destination Protocol Info
5 0.000150 127.0.0.1 127.0.0.1 TCP http-alt > 41781 [ACK] Seq=1 Ack=733 Win=34240 Len=0 TSV=6371041 TSER=6371041
Frame 5 (68 bytes on wire, 68 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: http-alt (8008), Dst Port: 41781 (41781), Seq: 1, Ack: 733, Len: 0
Source port: http-alt (8008)
Destination port: 41781 (41781)
Sequence number: 1 (relative sequence number)
Acknowledgement number: 733 (relative ack number)
Header length: 32 bytes
Flags: 0x10 (ACK)
Window size: 34240 (scaled)
Checksum: 0xe9f7 [correct]
Options: (12 bytes)
NOP
NOP
Timestamps: TSval 6371041, TSecr 6371041
[SEQ/ACK analysis]
No. Time Source Destination Protocol Info
6 0.181025 127.0.0.1 127.0.0.1 TCP http-alt > 41781 [ACK] Seq=1 Ack=733 Win=34240 [TCP CHECKSUM INCORRECT] Len=16384 TSV=6371086 TSER=6371041
Frame 6 (16452 bytes on wire, 16452 bytes captured)
Linux cooked capture
Internet Protocol, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
Transmission Control Protocol, Src Port: http-alt (8008), Dst Port: 41781 (41781), Seq: 1, Ack: 733, Len: 16384
Source port: http-alt (8008)
Destination port: 41781 (41781)
Sequence number: 1 (relative sequence number)
[Next sequence number: 16385 (relative sequence number)]
Acknowledgement number: 733 (relative ack number)
Header length: 32 bytes
Flags: 0x10 (ACK)
Window size: 34240 (scaled)
Checksum: 0x3e29 [incorrect, should be 0xe331 (maybe caused by "TCP checksum offload"?)]
Options: (12 bytes)
NOP
NOP
Timestamps: TSval 6371086, TSecr 6371041
Data (16384 bytes)
0000 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d HTTP/1.1 200 OK.
0010 0a 44 61 74 65 3a 20 54 75 65 2c 20 31 35 20 4a .Date: Tue, 15 J
0020 75 6e 20 32 30 31 30 20 30 39 3a 31 38 3a 32 39 un 2010 09:18:29
0030 20 47 4d 54 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 GMT..Content-Ty
0040 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c 3b 20 63 pe: text/html; c
0050 68 61 72 73 65 74 3d 55 54 46 2d 38 0d 0a 58 2d harset=UTF-8..X-
0060 50 6f 77 65 72 65 64 2d 42 79 3a 20 41 53 50 2e Powered-By: ASP.
0070 4e 45 54 0d 0a 53 65 74 2d 43 6f 6f 6b 69 65 3a NET..Set-Cookie:
0080 20 6a 73 65 73 73 69 6f 6e 69 64 3d 4d 58 46 4a jsessionid=MXFJ
0090 6d 71 4c 5a 32 63 77 6e 52 31 67 79 46 68 56 44 mqLZ2cwnR1gyFhVD
00a0 76 7a 47 35 39 7a 78 32 4b 63 50 32 76 4b 63 67 vzG59zx2KcP2vKcg
00b0 36 6c 4e 50 34 47 6e 7a 35 6e 56 6b 79 34 44 31 6lNP4Gnz5nVky4D1
00c0 21 31 35 35 36 30 36 39 33 36 35 3b 20 70 61 74 !1556069365; pat
00d0 68 3d 2f 0d 0a 58 2d 49 4e 45 4f 44 45 56 2d 43 h=/..X-INEODEV-C
[...]
0170 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d ................
0180 0a 0d 0a 20 0d 0a 20 0d 0a 0d 0a 0d 0a 0d 0a 0d ... .. .........
0190 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d ................
01a0 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d ................
01b0 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d ................
01c0 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d ................
01d0 0a 09 0d 0a 09 09 0d 0a 09 0d 0a 09 0d 0a 0d 0a ................
01e0 0d 0a 0d 0a 09 0d 0a 09 09 0d 0a 09 0d 0a 0d 0a ................
01f0 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a ................
0200 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a ................
0210 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a ................
0220 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a ................
0230 0d 0a 0d 0a 0d 0a 0d 0a 09 0d 0a 09 0d 0a 0d 0a ................
0240 0d 0a 0d 0a 0d 0a 09 0d 0a 0d 0a 0d 0a 3c 21 44 .............<!D
0250 4f 43 54 59 50 45 20 68 74 6d 6c 20 50 55 42 4c OCTYPE html PUBL
0260 49 43 20 22 2d 2f 2f 57 33 43 2f 2f 44 54 44 20 IC "-//W3C//DTD
0270 58 48 54 4d 4c 20 31 2e 30 20 54 72 61 6e 73 69 XHTML 1.0 Transi
0280 74 69 6f 6e 61 6c 2f 2f 45 4e 22 20 22 68 74 74 tional//EN" "htt
0290 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 54 p://www.w3.org/T
02a0 52 2f 78 68 74 6d 6c 31 2f 44 54 44 2f 78 68 74 R/xhtml1/DTD/xht
02b0 6d 6c 31 2d 74 72 61 6e 73 69 74 69 6f 6e 61 6c ml1-transitional
02c0 2e 64 74 64 22 3e 0d 0a 3c 68 74 6d 6c 20 78 6d .dtd">..<html xm
02d0 6c 6e 73 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e lns="http://www.
02e0 77 33 2e 6f 72 67 2f 31 39 39 39 2f 78 68 74 6d w3.org/1999/xhtm
02f0 6c 22 20 6c 61 6e 67 3d 22 66 72 22 3e 0d 0a 0d l" lang="fr">...
0300 0a 3c 68 65 61 64 3e 09 0d 0a 09 3c 6d 65 74 61 .<head>....<meta
0310 20 68 74 74 70 2d 65 71 75 69 76 3d 22 63 6f 6e http-equiv="con
0320 74 65 6e 74 2d 74 79 70 65 22 20 63 6f 6e 74 65 tent-type" conte
0330 6e 74 3d 22 74 65 78 74 2f 68 74 6d 6c 3b 20 63 nt="text/html; c
0340 68 61 72 73 65 74 3d 49 53 4f 2d 38 38 35 39 2d harset=ISO-8859-
0350 31 22 20 2f 3e 0d 0a 0d 0a 09 0d 0a 09 09 0d 0a 1" />...........
0360 09 09 0d 0a 09 09 09 0d 0a 0d 0a 0d 0a 0d 0a 09 ................
More information about the varnish-misc
mailing list