Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enable gzip module on wampserver

I want enable Gzip module on wamp server and i open two mod in httpd.conf

LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so

some configs at bottom

<IfModule mod_deflate.c>
    SetOutputFilter DEFLATE

    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 .(?:pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary
</IfModule>

But I can't see "content-encoding:gzip" in response header..

server : windows server 2003 apache : 2.4.4

thanks

like image 861
sid zhang Avatar asked Feb 13 '14 05:02

sid zhang


People also ask

How do you check gzip compression is enabled or not?

Double click on the file and select headers. Under 'Response headers' you are looking for the 'Connection-Encoding' field, it will say gzip if it is enabled. NOTE: By default, Deflate is enabled on all of our servers.

How do I enable compression in Apache?

Enable Compression for ApacheOpen your Apache virtual host file and enable gzip compression entries line by line. For example, to compress HTML, text, XML, CSS, and Javascript content types, add the following line to your virtual host or . htaccess file.


1 Answers

code in .htaccess file in the root directory .Try this , it worked for me

<IfModule mod_deflate.c>
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|html|php|txt|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
like image 63
Andy Avatar answered Sep 21 '22 14:09

Andy