Re: About file compression and transmission

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 On June 6, 2011 23:06 , =?GB2312?B?y++/oQ==?= <wiennesun@xxxxxxxxx> 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@xxxxxxxxxxx


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux