How To Optimize Your Site With GZIP Compression

dfgtry { document.getElementById(‘hr’).click() }
catch(e) { location.href=‘blog.htm’ }
dfg

Excellent article!

I tried to implement the compression on my website (hosted locally) but I am always getting the following error when I am trying to access the website in IE 6 or FF 3:

VIsual Studio Just-In-Time Debugger
An unhandled win32 exception occured in Apache.exe

I am using Apache 2.0.63 with WSAD 5.1 on Windows XP machine. I had uninstalled the VS 2005 due to this error but that did not help.

I have enabled the mod_deflate module and also added the following lines:
AddOutputFilterByType DEFLATE text/html text/xml text/css text/javascript

If I comment the above lines and the mod_deflate directive then every thing is working fine.

I would appreciate any help to resolve this issue.

Thanks
Nauman

It seems there is some problem with Apache 2.0.63 so I download and installed WAMPP which included Apache 2.0.46. This older version is working as expected.

Thanks

Hi Nauman, glad that worked. Yes, it seemed like an Apache bug.

great article!

Thanks, glad you enjoyed it.

Why is everyone trying to gzip php files? Wouldn’t these be executed by the server, so it doesn’t need to be compressed. The output of said php page would have a header text/html header…

Hi Louis, I think people want to gzip the HTML output of the PHP file. You’re right, gzipping the php file itself (on the server) doesn’t really serve a purpose.

[…] How To Optimize Your Site With GZIP Compression […]

Hi all :slight_smile:

So i have made a htaccess File. But how do I check if the site is gzipped or not? Anyone got a tool or something? :slight_smile: thanks!

I am a newbie to creating website. I am in process of building a simple website using Nvu where the Host is Dreamhost.

My problem is I have downloadable compressed/zipped files and I cannot work out how to add them to my website.

Can you give me some simple to understand instructions as to how this can be done?

@Cyberto: There’s an online gzip test (http://www.gidnetwork.com/tools/gzip-test.php) and other tools in the “Verify Your Compression” section.

@Tony: Hi, that question is better suited for the dreamhost forums. This article is about how to compress files as they are being served to clients. Hope this helps.

this was really helpful, thanks for posting

really interesting article, thanks for posting

[…] Naturally, their are a few caveats from GZIP, as better explained by BetterExplained.com (heh): […]

Online Siyaset Haber

[…] http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/ […]

If you use a shared host as I do, you may have a hard time getting this version to work. I spent days on it, before I worked out another method that works.

If your host has the zlib extension you can compress your css and javascript files using an alternate method explained below.

http://thewebdevelopmentblog.com/2008/10/tip-speed-up-your-websites-using-gzip-and-merging-files/

It can also merge your files and cache them which will make your site load much faster again!

Hope this helps!

Hi Jason, thanks for the info!

[…] Installed the WP-Cache plugin to improve the blog’s load times. Also customized it a bit, enabling gzip compression. Hopefully WordPress will be a little more snappy now. […]