You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Nigel Hamilton <ni...@e1mail.com> on 2000/11/30 19:14:27 UTC

More Speed -> mod_perl Module for HTML Compression

Hi,
	I'm trying to reduce the amount of data sent from server to
browser by using compression ---> hopefully accelerating the time to
serve a page.

	Does anyone know of a mod_perl module that compresses HTML and a
companion Javascript procedure that decompresses the data on the
client-side?

	I know there are Gzip modules that zip files on the way back to
the browser ... but I'm after something that zips on the server and  
decompresses transparently in Javascript across all browsers. Ideally I
want to do: document.write(uncompressed-contents) in Javascript on the
client-side.

	Has anyone come up with something for this?

	Also for average-sized files, does the time taken to perform the
decompression/compression negate any speed increase gained by reduced file
size?

Nige

Nigel Hamilton
______________________________________________________________________________


Re: More Speed -> mod_perl Module for HTML Compression

Posted by Joshua Chamas <jo...@chamas.com>.
Nigel Hamilton wrote:
> 
>         Does anyone know of a mod_perl module that compresses HTML and a
> companion Javascript procedure that decompresses the data on the
> client-side?
> 
>         I know there are Gzip modules that zip files on the way back to
> the browser ... but I'm after something that zips on the server and
> decompresses transparently in Javascript across all browsers. Ideally I
> want to do: document.write(uncompressed-contents) in Javascript on the
> client-side.
> 

To add to Matt's comments and likely Ged would agree, you'll probably
find that Gzip compression is better supported cross browser than
any JavaScript you could come up with.  JavaScript breaks in lots of
ways all the time if you just look at IE4-IE5, NS4.0x-NS4.7x.  And then
look at them on NT/2000 vs. 95/98/ME, that'll really kill ya.

--Josh

_________________________________________________________________
Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Re: More Speed -> mod_perl Module for HTML Compression

Posted by "Randal L. Schwartz" <me...@stonehenge.com>.
>>>>> "Ken" == Ken Williams <ke...@forum.swarthmore.edu> writes:

Ken> In particular, it seems like you think that users have to manually
Ken> decompress gzipped content, but that's not the case.  Just thought I'd
Ken> state it if that was the confusion.

Ken> mod_gzip, Apache::Compress, or Apache::Gzip are solutions here.

Or even my cool compressing pre-forking tiny proxy at
  <http://www.stonehenge.com/merlyn/WebTechniques/col34.html>

Neatly proxies, but sends compressed text across slow links if
the browser understands that.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<me...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Re: More Speed -> mod_perl Module for HTML Compression

Posted by Ken Williams <ke...@forum.swarthmore.edu>.
nigel@e1mail.com (Nigel Hamilton) wrote:
>	I'm trying to reduce the amount of data sent from server to
>browser by using compression ---> hopefully accelerating the time to
>serve a page.
>
>	Does anyone know of a mod_perl module that compresses HTML and a
>companion Javascript procedure that decompresses the data on the
>client-side?
>
>	I know there are Gzip modules that zip files on the way back to
>the browser ... but I'm after something that zips on the server and  
>decompresses transparently in Javascript across all browsers. Ideally I
>want to do: document.write(uncompressed-contents) in Javascript on the
>client-side.

I think you've got a slight misconception about how gzip HTTP
compression works.  It's perfectly transparent, in that browsers that
support compression will decompress the file automatically, and the user
will never know that the page was compressed in the first place.  That's
much smoother than the javascript decompression you propose, which I
can't help thinking will turn into a real headache, perhaps even a
nightmare.

In particular, it seems like you think that users have to manually
decompress gzipped content, but that's not the case.  Just thought I'd
state it if that was the confusion.

mod_gzip, Apache::Compress, or Apache::Gzip are solutions here.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum

Re: More Speed -> mod_perl Module for HTML Compression

Posted by Matt Sergeant <ma...@sergeant.org>.
On Thu, 30 Nov 2000, Nigel Hamilton wrote:

> Hi,
> 	I'm trying to reduce the amount of data sent from server to
> browser by using compression ---> hopefully accelerating the time to
> serve a page.
>
> 	Does anyone know of a mod_perl module that compresses HTML and a
> companion Javascript procedure that decompresses the data on the
> client-side?
>
> 	I know there are Gzip modules that zip files on the way back to
> the browser ... but I'm after something that zips on the server and
> decompresses transparently in Javascript across all browsers. Ideally I
> want to do: document.write(uncompressed-contents) in Javascript on the
> client-side.
>
> 	Has anyone come up with something for this?

Nobody here would be mad enough to do this... Is it on an intranet? If
not, you'll never get me visiting your site - I don't enable javascript
generally.

> 	Also for average-sized files, does the time taken to perform the
> decompression/compression negate any speed increase gained by reduced file
> size?

I don't think so, but it probably depends a huge amount on the size of
your pipe and how many pages you're hoping to server. For example, I'm on
a 64K pipe, so CPU isn't the limiting factor of what I can serve - the
pipe is. So I gzip and can serve more pages.

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\