Mod_Deflate :-
mod_deflate is an module of an Apache HTTP Web Server. The basic purpose of mod_deflate is to speedup download web page access time. It provides DEFLATE output filter that allows output from webserver to webbrowser in the form of compression format.
It results in faster website access and decreases the amount of time in data transmission from web server to web browser.
mod_gzip or mod_gz modules are similar to mod_deflate which compresses the contents using different implementations like gzip implementations and external zlib library respectively.
You can check the gzip compression for website using below link :-
http://aruljohn.com/gziptest.php
How to Enable Mod_Deflate :-
1) # /scripts/easyapache
Above line only compress html and xml files. Here is the configuration from one of my production box:
Close and save the file. Next restart apache web server. All of the above extension file should compressed by mod_deflate:
mod_deflate is an module of an Apache HTTP Web Server. The basic purpose of mod_deflate is to speedup download web page access time. It provides DEFLATE output filter that allows output from webserver to webbrowser in the form of compression format.
It results in faster website access and decreases the amount of time in data transmission from web server to web browser.
mod_gzip or mod_gz modules are similar to mod_deflate which compresses the contents using different implementations like gzip implementations and external zlib library respectively.
You can check the gzip compression for website using below link :-
http://aruljohn.com/gziptest.php
How to Enable Mod_Deflate :-
1) # /scripts/easyapache
2) Adding the code under .htaccess file
<IfModule
mod_deflate.c>
AddOutPutFilterByType DEFLATE text/html text/plain text/xml
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>
AddOutPutFilterByType DEFLATE text/html text/plain text/xml
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>
3) Append below code under httpd.conf
LoadModule deflate_module modules/mod_deflate.so
Append following configuration <Location /> directive:
<Location />
AddOutputFilterByType DEFLATE text/html text/plain text/xml
....
...
<Location>
<Location />
...
...
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/x-httpd-eruby
AddOutputFilterByType DEFLATE text/html
...
...
<Location>
Close and save the file. Next restart apache web server. All of the above extension file should compressed by mod_deflate:
# /etc/init.d/httpd restart
More Information
No comments:
Post a Comment