Reputation: 189
I'm working on windows7 64bit env.How should I enable gzip module on apache 2.2.17? And what are differences between mod_deflate and mod_gzip? thanks
Upvotes: 5
Views: 32418
Reputation: 277
Also note that mod_filter needs to be loaded as well as mod_deflate (due to both being commented out by default):
LoadModule filter_module modules/mod_filter.so
LoadModule deflate_module modules/mod_deflate.so
Like the previous comment: After that just add following to the httpd.conf:
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
Tested on: Apache/2.4.10
Note: mod_filter is required in 2.4, although in 2.2 that may not be the case.
Upvotes: 6
Reputation: 253
mod_deflate module is shipped with Apache, but in order to use it, you should enable one in your httpd.conf
file (it is initially commented out):
LoadModule deflate_module modules/mod_deflate.so
After that just add following to the httpd.conf
:
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
For more tuning refer, as was mentioned: http://httpd.apache.org/docs/2.2/mod/mod_deflate.html
Upvotes: 9
Reputation: 5572
You can enable it like this in your apache config file, or .htaccess file if enabled
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript application/json
</IfModule>
See: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
Upvotes: 12
Reputation:
There is no mod_gzip
for Apache 2.2x, as it is an Apache 1.3x module. Apache 2.2x has a only mod_deflate
. GZip is the same DEFLATE plus a checksum and header/footer. As you can see here, Deflate is faster.
Upvotes: 9