I don't use this feature, it just puts extra work on the server and
client to save something. If service providers think it is necessary
to save bandwidth, they could probably compress the content
themselves. But from looking at the code, you shouldn't have to do
anything except configure the module to get transparent compression.
You have to set minimum file content size, etc. and adp needs
independent configuration if you use adps. In other words, you don't
have to edit your site code to get compression with ns_zlib.

tom jackson

On Wed, Dec 1, 2010 at 9:11 AM, Alexey Pechnikov <[email protected]> wrote:
> 2010/12/1 Tom Jackson <[email protected]>
>>
>> BTW, I think the functionality in the external module nsreturnz is now
>> part of nszlib
>
> But are you sure that this works? In my tests only ns_returnfile work
> correct for gzipped content:
>
> ns_register_proc GET /test  ad_test_proc
> proc ad_test_proc {ignore} {
>     ns_updateheader Content-Encoding gzip
>     ns_return 200 text/plain [ns_zlib gzip "test"]
> }
> $ curl http://localhost:8200/test 2>/dev/null| hexdump
> 0000000 c21f 088b 0000 0000 0000 2b03 2d49 012e
> 0000010 0c00 7f7e 98c3 0004 0000
> 000001a
>
> ns_register_proc GET /test  ad_test_proc
> proc ad_test_proc {ignore} {
>     set fd [open /tmp/test.gz r]
>     fconfigure $fd -translation binary -encoding binary
>     ns_updateheader Content-Encoding gzip
>     ns_return 200 text/plain [read $fd]
>     close $fd
> }
> $ echo -n test|gzip>/tmp/test.gz
> $ curl http://localhost:8200/test 2>/dev/null| hexdump
> 0000000 c21f 088b c300 7f99 b6c3 004c 2b03 2d49
> 0000010 012e 0c00 7f7e 98c3 0004 0000
> 000001c
>
> ns_register_proc GET /test  ad_test_proc
> proc ad_test_proc {ignore} {
>     ns_updateheader Content-Encoding gzip
>     ns_returnfile 200 text/plain /tmp/test.gz
> }
> $ echo -n test|gzip>/tmp/test.gz
> $ curl http://localhost:8200/test 2>/dev/null| hexdump
> 0000000 8b1f 0008 7fd9 4cf6 0300 492b 2e2d 0001
> 0000010 7e0c d87f 0004 0000
> 0000018
> Browsers can show only last question result. I don't understand how ns_zlib
> encode 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.

Reply via email to