ZigPressZigPress

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
</ifmodule>

3. Restart Apache.

Job done!

Found this useful? Share it:
  • StumbleUpon
  • Digg
  • Technorati
  • Slashdot
  • del.icio.us
  • Facebook
  • LinkedIn

8 Comments about “Enabling GZip on WAMP”

  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
    ifmodule mod_deflate.c
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript
    /ifmodule

    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!

     

Make a Comment

Comments are "dofollow", but they are still moderated and filtered for spam.