Words about WordPress from Malta

Enabling GZip on WAMP

If you use WAMP (www.wampserver.com) to develop websites on a local PC, then you probably don’t need to enable gzip (server-side file compression to reduce the amount of data transferred when a web page is requested).

However, it can still be useful, letting you see how well a page may be compressed by your live web host without having to actually upload it.

Enabling gzip on WAMP is actually quite easy, though most of the advice I found was wrong. Here’s what worked for me.

1. In the WAMP tray applet, enable Apache’s deflate_module and headers_module (letting the service restart each time).

2. In the WAMP tray applet, edit Apache’s httpd.conf and add the following snippet just before the include line at the very end (note: between the ifmodule tags it’s just one line of code – don’t break it):

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript

3. Restart Apache.

Job done!


  1. where do i insert the code?

  2. After the last ‘/ifmodule’.

  3. LIKE THIS???

    # Note: The following must must be present to support
    # starting without SSL on platforms with no /dev/random equivalent
    # but a statically compiled-in mod_ssl.
    IfModule ssl_module
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    ifmodule mod_deflate.c
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript

    Include c:/wamp/alias/*

  4. Yep, that looks OK. I know my blog comment system removes all the angle brackets but I can see where you placed the code.

  5. This is the article I have been looking for! Good work! Andy!

  6. Dont forget to check PHP setting > zlip output compression

  7. Will this work on XAMPP?

  8. Very good tips. Thanks a lot!

  9. Is it working on XAMPP?

  10. Deflate is not gzip!

  11. Just tried to insert the code but failed. Have a feeling might have inserted it in the wrong section. Is it working on XAMPP?

  12. @matt — actually deflate is still gzip, same compression scheme.

    Anyway, I use mod_deflate, tested my output at http://www.gzipcheck.com and confirmed that content is gzipped.

    Works fine for me on xampp, thank you zigpress :)

  13. Hi,
    Just tried this with WAMP 2.2 and the services fail to restart with your code snippet.
    I had to change to

    Hope this helps anyone else who encounters this problem.

  14. looks like the comments here don’t allow tags…you need to change
    IFmodule mod_deflate.c
    IFmodule mod_deflate

    in apache’s httpd.conf file

  15. Apache did not restart, I was getting ‘Invalid command ‘AddOutputFilterByType’, perhaps misspelled or defined by a module not included in the server configuration’ in windows event viewer.
    You can fix it by un-commenting/enabling ‘mod_filter’ module from apache’s httpd.conf file.

Comments are closed