Mod_Gzip is an external extension module for Apache 1.3 web servers implemented to help with size reduction of web pages served over HTTP. The alternative of mod_gzip for Apache 2 is called mod_deflate and it is enabled on all Hostlantern shared servers.
You can enable mod_deflate for your website directly from your cPanel > Optimize Website, or by adding the following lines to your .htaccess file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems...
BrowserMatch^Mozilla/4gzip-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>
|
If you are still running an Apache 1.3 web server and you have mod_gzip installed and loaded in Apache's configuration, you can enable it by adding the following options in an .htaccess file for your hosting account:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<IfModule mod_gzip.c>
mod_gzip_static_suffix.gz
AddEncoding gzip.gz
AddEncoding gzip.gzip
mod_gzip_on YES
mod_gzip_handle_methods GET
mod_gzip_temp_dir/tmp
mod_gzip_can_negotiate Yes
mod_gzip_dechunk Yes
mod_gzip_send_vary On
mod_gzip_update_static No
mod_gzip_keep_workfiles No
mod_gzip_minimum_file_size250
mod_gzip_maximum_file_size1048576
mod_gzip_maximum_inmem_size60000
mod_gzip_min_http1000
mod_gzip_item_exclude reqheader"User-agent: Mozilla/4.0[678]"
mod_gzip_item_exclude file.js$
mod_gzip_item_exclude file.css$
mod_gzip_item_exclude mime^application/pdf$
mod_gzip_item_exclude mime^image/
mod_gzip_item_exclude mime^application/x-javascript$
mod_gzip_item_include mime^text/.*
mod_gzip_item_include file.html$
mod_gzip_item_include file.pl$
mod_gzip_item_include file.cgi$
mod_gzip_item_include handler^cgi-script$
mod_gzip_item_include mime^httpd/unix-directory$
mod_gzip_item_include mime^application/postscript$
</IfModule>
|