Hello

I'm experimenting with gzip compression. I'm working on my own fastcgi
based framework, and as far as I've seen I'm doing exactly (except the 'if
0' stuff from which Matt suffered :-) the same as Apache::GzipChain (hmm,
I've just realized that there are also two other Apache:: compression
modules). What I've found to be strange is, that at least Netscape browsers
(version 4.6 linux and 4.51 macos) change their caching strategy when being
sent gzipped content: I'm sending a "Last-modified: Sat, 15 Jul 2000
19:13:32 GMT" header, which is really sent by apache as you can see in the
tcpdump output below, but if using gzip compression, netscape requests the
page each time again.

I'm wondering whether the gzip part itself carries a modification date?:
>From Compress/Zlib.pm:

sub MAGIC1() { 0x1f }
sub MAGIC2() { 0x8b }
sub OSCODE() { 3    }
...
  # write a minimal gzip header
  my(@m);
  push @m, pack("c10", MAGIC1, MAGIC2, Z_DEFLATED(), 0,0,0,0,0,0, OSCODE) ;
...

Maybe the zero's should really be a timestamp?


The output from tcpdump:

19:47:21.000000 testwww.ethz.ch.www > testwww.ethz.ch.1759: P 1:2079(2078)
ack 4
07 win 31072 <nop,nop,timestamp 8815933 8815685> (DF)

E..RC%@.@.l.....  : 4500 0852 4325 4000 4006 6c2e c0a8 0101
.....P...H....p.  : c0a8 0101 0050 06df 1848 f9d3 181c 70a1
..y`!p.........=  : 8018 7960 2170 0000 0101 080a 0086 853d
...EHTTP/1.1 200  : 0086 8445 4854 5450 2f31 2e31 2032 3030
 OK..Date: Sun,   : 204f 4b0d 0a44 6174 653a 2053 756e 2c20
24 Sep 2000 17:4  : 3234 2053 6570 2032 3030 3020 3137 3a34
7:18 GMT..Server  : 373a 3138 2047 4d54 0d0a 5365 7276 6572
: Apache/1.3.9 (  : 3a20 4170 6163 6865 2f31 2e33 2e39 2028
Unix) mod_perl/1  : 556e 6978 2920 6d6f 645f 7065 726c 2f31
.24 mod_fastcgi/  : 2e32 3420 6d6f 645f 6661 7374 6367 692f
2.2.2 mod_ssl/2.  : 322e 322e 3220 6d6f 645f 7373 6c2f 322e
4.9 OpenSSL/0.9.  : 342e 3920 4f70 656e 5353 4c2f 302e 392e
4..Last-modified  : 340d 0a4c 6173 742d 6d6f 6469 6669 6564
: Sat, 15 Jul 20  : 3a20 5361 742c 2031 3520 4a75 6c20 3230
00 19:13:32 GMT.  : 3030 2031 393a 3133 3a33 3220 474d 540d
.Content-encodin  : 0a43 6f6e 7465 6e74 2d65 6e63 6f64 696e
g: gzip..Content  : 673a 2067 7a69 700d 0a43 6f6e 7465 6e74
-length: 1760..K  : 2d6c 656e 6774 683a 2031 3736 300d 0a4b
eep-Alive: timeo  : 6565 702d 416c 6976 653a 2074 696d 656f
ut=15, max=99..C  : 7574 3d31 352c 206d 6178 3d39 390d 0a43
onnection: Keep-  : 6f6e 6e65 6374 696f 6e3a 204b 6565 702d
Alive..Content-T  : 416c 6976 650d 0a43 6f6e 7465 6e74 2d54
ype: text/html..  : 7970 653a 2074 6578 742f 6874 6d6c 0d0a
...............r  : 0d0a 1f8b 0800 0000 0000 0003 ed9b cd72
.6......ej......  : e336 12c7 cfa3 a7e8 656a b397 d197 bfe2
q$MI&e).l...7.Ab  : 7124 4d49 2665 29b6 6caf c5b1 37b9 4162
...


BTW can anyone give me a link to documentation about all the possible
caching/expires/modification directives? A particular problem I have is
with MSIE 3 (Mac): unlike Netscape this browser doesn't request pages again
if I enter the same page again and I didn't send any modification
date/caching pragma. So I have to send an 'expires: now' because of this
browser, but this makes Netscape request pages again even if just going
BACK in history. This is a pitty, since I liked Netscapes behaviour not to
request pages again when going back, but requesting them again if entered
them again by following a link ('forwardly').

Thanks,
Christian.


Reply via email to