httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Montague <m...@catseye.org>
Subject Re: [users@httpd] About file compression and transmission
Date Tue, 07 Jun 2011 04:30:10 GMT
 On June 6, 2011 23:06 , =?GB2312?B?y++/oQ==?= <wiennesun@gmail.com> wrote:
> The file is stored in text format prior to transmission is, every time
> there is file access,
> apache the file in memory after compression by gzip module to send to
> the client.
> That there is duplication of the same file read, compression,
> transmission.
>
> Is there any function can use a similar gzip file compression program
> stored in advance,
> For example, jquery.js.gz, when there is access to jquery.js
> jquery.js.gz sent directly to the client,
> The client to decompress the file. Rather than to repeat the
> compression jquery.js apache files.

Use mod_deflate, see
http://httpd.apache.org/docs/2.0/mod/mod_deflate.html The files will not
be compressed in advance, but this is OK: cost of compression is
minimal, and modern CPUs can easily do it without problems.

I do not recommend this, but if you still want to compress files in
advance, see
http://www.cravediy.com/59-Simple-gzip-Support-for-Apache-with-mod_rewrite.html
Note that even though the files are compressed in advance, there is
duplication of the same file read and transmission -- the only thing you
save is the compression step. But this requires you to have two copies
of every file: a compressed copy, and an uncompressed copy (for browsers
that do not support compressed content encoding). Also, be careful to
re-create the compressed version any time you update the non-compressed
version, or you will serve different versions of the files to different
web browsers and this problem may be hard to diagnose.

--
  Mark Montague
  mark@catseye.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message