How to enable compression in WAMP installed on Windows Server?
Solution 1
To enable Deflate compression for resources with WAMP (thus Apache), you can use this following code in your .htaccess file:
<IfModule mod_deflate.c>
<FilesMatch "\.(html|php|txt|xml|js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
It works well for several websites I own.
Solution 2
For use, AddOutputFilterByType
should also activate the filter module. Uncomment LoadModule filter_module modules/mod_filter.so
in the httpd.conf file
Related videos on Youtube
MJ X
Experienced developer with over 10 years of experience and an excellent track record of building, architect and delivering highly reliable and scalable systems/software across a variety of areas and technologies with strong ability to communicate technical concepts and issues to technical and non-technical people alike. Areas of expertise include the following: Azure, AWS, SharePoint, Web Application & Database development, ASP.Net Core, ASP.Net MVC, Angular, Bootstrap, Node.js, GraphQL
Updated on September 18, 2022Comments
-
MJ X over 1 year
How to enable compression in WAMP running on Windows Server 2008?
I searched the net and I followed these steps given here: http://www.zigpress.com/2009/04/09/enabling-gzip-on-wamp/.
But after restarting my WAMP the icon got yellow not green.
Than followed this post: http://forum.wampserver.com/read.php?2,93406.
Again the same problem my WAMP icon after restarting gets yellow.
This is the code I put in Apache httpd.conf:
<ifmodule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript </ifmodule>
-
Zistoloen over 10 yearsDid you try to use .htaccess instead of httpd.conf?
-
MJ X over 10 yearsIf you have any example please share it
-
-
Odys about 9 years+1 In the default WAMP installation, one can enable the deflate module from the UI, but this will not be enough if you want to use
AddOutputFilterByType
. You will also need to do this.