I'm pretty sure that gzip compression is already natively and transparently
supported in AOLserver as long as you build and include the ns_zlib module.
You shouldn't ever have to bother with encoding or calling a special
function; rather, you just need to enable it in the config file: "ns_param
gzip on" in the ns/server/${server} section of your config file (there's
also a gzipmin param to set the minimum size required in bytes to trigger
compression).

One problem is that AOLserver doesn't gzip content when ns_return is called;
it works for pretty much every scenario except that one.  I don't know why
this is the case; we just hacked this by recompiling nsd to always gzip
regardless of the config file, as long as the client supports it (line 161
of connio.c).  It would be nice if this worked correctly by default (or if
we figured out the proper way to enable its use in ns_return).


On Wed, Dec 1, 2010 at 9:46 PM, Tom Jackson <[email protected]> wrote:

> All you are doing here is using ns_zlib in Tcl. Who cares if this
> works or not? It is possible that HTTP content compression is slightly
> different than what is produced by ns_zlib. But this doesn't matter
> really. What you should be testing is ns_returnz (sp?) or ns_return
> (or adp output) with transparent compression (which takes into account
> client capabilities, you can't just blindly send compressed content).
>
> I remember looking into ns_zlib just because it was part of the adp
> processing/fastpath code. I don't have any reason to believe that, if
> configured correctly it doesn't work. I also doubt that ns_zlib would
> have wound up in the core unless it worked, the author is well known
> and I've never heard of anyone suggesting any of the repo modules
> "don't work".
>
> I'll try to look into how ns_zlib is supposed to work. Maybe this is a
> total lack of documentation problem.
>
> tom jackson
>
> On Wed, Dec 1, 2010 at 10:19 AM, Alexey Pechnikov
> <[email protected]> wrote:
> > This work correct:
> > ns_register_proc GET /test  ad_test_proc
> > proc ad_test_proc {ignore} {
> >     set gzip [ns_zlib gzip "test"]
> >     set time [ns_httptime [ns_time]]
> >     ns_write "HTTP/1.0 200 OK
> > Content-Type: text/plain; charset=utf-8
> > Content-Encoding: gzip
> > \n"
> >     ns_write $gzip
> > }
> > $ curl http://localhost:8200/test 2>/dev/null| hexdump
> > 0000000 8b1f 0008 0000 0000 0300 492b 2e2d 0001
> > 0000010 7e0c d87f 0004 0000
> > 0000018
> >
> > But is possible to disable all output translations by ns_return? Where is
> > documented how ns_return process the data?..
> > --
> > Best regards, Alexey Pechnikov.
> > http://pechnikov.tel/
> >
> > --
> > AOLserver - http://www.aolserver.com/
> >
> > To Remove yourself from this list, simply send an email to
> > <[email protected]> with the
> > body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject:
> > field of your email blank.
> >
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to <
> [email protected]> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
> Subject: field of your email blank.
>



-- 
Hossein Sharifi
http://rateyourmusic.com


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<[email protected]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to