Apache under the Ifmodule set meaning

Source: Internet
Author: User

<ifmodule mod_deflate.c>
Setoutputfilter DEFLATE #必须的, like a switch, tells Apache to compress the content transferred to the browser

Setenvifnocase Request_uri. (?: gif|jpe?g|png) $ no-gzip dont-vary #设置不对后缀gif, jpg,jpeg,png picture file compression
Setenvifnocase Request_uri. (?: Exe|t?gz|zip|bz2|sit|rar) $ no-gzip dont-vary #同上, is not set Exe,tgz,gz ... The files are compressed
Setenvifnocase Request_uri. (?:p df|mov|avi|mp3|mp4|rm) $ no-gzip dont-vary

Addoutputfilterbytype DEFLATE text/* #设置对文件是文本的内容进行压缩, such as text/html text/css Text/plain
Addoutputfilterbytype DEFLATE application/ms* application/vnd* application/postscript application/javascript Application/x-javascript #这段代码你只需要了解application/javascript application/x-javascript This section is ready, The meaning of this paragraph is to compress the JavaScript file
Addoutputfilterbytype DEFLATE application/x-httpd-php application/x-httpd-fastphp #这段是告诉apache对php类型的文件进行压缩

Browsermatch ^MOZILLA/4 gzip-only-text/html # Netscape 4.x There are some problems, so only the compressed file type is text/html
Browsermatch ^mozilla/4.0[678] No-gzip # Netscape 4.06-4.08 There are more problems, so do not turn on compression
Browsermatch \bmsie!no-gzip!gzip-only-text/html # IE will disguise itself as Netscape, but in fact it's no problem
</IfModule>

<ifmodule deflate_module>
Setoutputfilter DEFLATE
# Don ' t compress images and other
Setenvifnocase Request_uri. (?: gif|jpe?g|png) $ no-gzip dont-vary
Setenvifnocase Request_uri. (?: Exe|t?gz|zip|bz2|sit|rar) $ no-gzip dont-vary
Setenvifnocase Request_uri. (?:p df|doc) $ no-gzip dont-vary
Addoutputfilterbytype DEFLATE text/html text/plain text/xml text/css
Addoutputfilterbytype DEFLATE Application/x-javascript
</IfModule>

Apache under the Ifmodule set meaning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.