Copy This and Put It Here
Copy
<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], ‘gzip‘)) ob_start(“ob_gzhandler”); else ob_start(); ?>
Paste A (for WordPress users)
For WordPress users, paste the code up at the very top of your header.php file (above the DOCTYPE line). If you’re not sure how to do this, see the video at the end of this tutorial.

Paste B (for static .html pages)
If your website is coded in html and not php, then what you’ll need to do is copy the code above and paste it up at the very top of each web page you want to compress (above the DOCTYPE).
The one change you’ll need to do here is change the extension of your web pages from .html to .php.
So for example, change: index.html to index.php
You can test your results by visiting http://www.port80software.com.















September 22nd, 2009 at 11:35 am
Hi John, very impressive!
I shall be giving it a go shortly.
A couple of points that may help your readers who have static html sites…
First, before you change pages to php, make sure that your hosting service has php on the server you are hosted on. My first site was on a server which was very cheap but didn’t have php.
Second… use a 301 redirect to direct searches and links for the old html pages to the new php pages. There are lots of articles on the web about how to implement a 301 redirect.
September 22nd, 2009 at 11:37 am
Sorry, forgot to add…
Did I notice Wordpress 2.8.4 in the video?
Good to see that you are keeping up to date.
September 22nd, 2009 at 7:19 pm
Hi Keith, thanks. Try it out – it works really well. I emailed it to a friend and they tried it out and said they had to change their shorts afterwards LOL.
Good point about making sure your web hosts uses PHP. If it doesn’t, we certainly offer it. And your comment got me thinking; maybe I’ll do up some .htaccess tutorial videos. I see codes all over online, but no one really shows them in videos, which I’m sure newbies would like since they probably don’t really even know what a .htaccess file is.
Definitely keep my blogs up to date. Always got to be on top of security, ya know.
December 2nd, 2009 at 3:26 pm
Hi John
Started to see posts about Google adding “load time ” as one of the metrics in its algorithm.
Makes this post even more important!
December 2nd, 2009 at 6:49 pm
That’s interesting. I’ll have to look into that.
March 6th, 2010 at 2:46 am
Hi John
Came across an article at “Wordpress How To Spotter” that gives details of a tool that checks if your host supports gzip.
Link to full article is
http://www.howtospoter.com/web-20/wordpress/3-webmaster-tools-to-improve-blog-performance
The tool is the first one that is discussed.
Hope people find it useful
March 6th, 2010 at 2:48 am
Sorry for second comment John.
Meant to say…. like the new Avatar.
Shades of sepia?
March 6th, 2010 at 6:29 am
Hi Keith. Hey thanks for the tool and the mention about the avatar.
Yeah I went with sepia tone, why not, right?
That picture is actually a picture of me holding my 2nd born on his first day in this world. Somehow I didn’t think the picture of a newborn though was what I should put in my avatar. But I think about it every time I see it.
Also, thanks for the mention on your blog. I appreciate that.