Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mod_deflate module based on httpd

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

1. Role

Save bandwidth, extra CPU consumption; some older browsers do not support;

compressing resources suitable for compression, such as text files;

2. Related modules

LoadModule deflate_module modules/mod_deflate.so (CentOS6 default enabled)

3. Configuration (httpd-2.2)

~]# vim /etc/httpd/conf.d/mod_deflate.conf

enter the following code

SetOutputFilter DEFLATE#Set compression filter, Indicates which types are suitable for compression # mod_deflate configuration# Restrict compression to these MIME typesAddOutputFilterByType DEFLATE text/plainAddOutputFilterByType DEFLATE text/htmlAddOutputFilterByType DEFLATE application/xmlAddOutputFilterByType DEFLATE text/xmlAddOutputFilterByType DEFLATE application/x-javascriptAddOutputFilterByType DEFLATE text/javascriptAddOutputFilterByType DEFLATE text/css# Level of compression (Highest 9 - Lowest 1)DeflateCompressionLevel 6 #Compression level depends on CPU consumption and bandwidth, 6 is default # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html# Netscape 4.06-4.08 have some more problemsBrowserMatch ^Mozilla/4\.0[678] no-gzip# MSIE masquerades as Netscape, but it is fineBrowserMatch \bMSIE ! no-gzip ! gzip-only-text/html

~]# httpd -t~]# service httpd reload

4. Confirm the compression effect

configure the front

post-configured

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report