Welcome back dear visitors. Wait for most awaited article ends now. We are demonstrating here the best available method for gearing up your website that is rock solid. Our guide is for the websites that are hosted on Apache server. We are taking advantage of Apache 2.0 and going to use server based optimisation for our web site instead of any plug-in or script available in market.
But before starting our work, we need to analyze our web site. Open the following URL http://www.websiteoptimization.com/services/analyze/ and enter your website address in “Enter URL to Diagnose” text field and hit enter. New screen will welcome you; enter the CAPTCHA keywords and wait for detailed analysis of your site. In analysis result page you will find a lot of information under Diagnosis heading. Check the total size of your web site and the Download times. Don’t close or change this page, we will use it to compare the results.
Apache 2.0 has great improvement and has introduced some new modules and improved. To speed up our websites, hosted on Apache 2.0.x, we have two approaches.
• Deflate Approach
• Gzip Approach.
Detailed information about them is available on web so without going in complexity and detail, I will explain both in simple words. Deflate is the raw compression method, no file information, header, file size and checksum is given in deflate based compression.
While Gzip is the combination of deflate and all other information that are missing in deflate. Remember, Deflate is faster than Gzip. Detailed information is available here. mod_deflate.c is the core module working behind the scene for deflate type of compression.
Let’s start our project. Open your FTP client software and download the file .htaccess file from root of website i.e /public_html/.
After downloading file, open it in your faviourate editor. You will see some coding, don’t edit them, just add the following code to the file.
# BEGIN Compress text files
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png|rar|zip)$ no-gzip
# properly handle requests coming from behind proxies
Header append Vary User-Agent
# END Compress text files
In above coding, we called the module first, to compress all the contents and then manually defined file types to exclude from compression. Don’t compress pdf, image and movie files as they are already compressed. For optimising images use adobe and optimised file types like .png, where applicable.
For older browsers who don’t handle compression add this code after the above code.
# Properly handle old browsers that do not support compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
This code is guiding the old browsers according to their functionality. So the complete code for speeding up your web site, that is secure as well, is;
# BEGIN Compress text files
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png|rar|zip)$ no-gzip
# properly handle requests coming from behind proxies
Header append Vary User-Agent
# END Compress text files
# Properly handle old browsers that do not support compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
Now upload the file to same website root folder and hit refresh button. Open a new webpage and enter same URL we used to analyze our web site earlier. Repeat the process and compare the difference in both results. Check the new size of your web page and the downloading time on various speeds. At the end of same page, you have suggestions to further speed up your site. You have gained at least 35-40% optimisation of website.
This is the part one of optimizing the website. We are preparing the second part which is primarily focused on wordpress. Combined effect of both parts will give you ultimate speed to your wordpress web site.
Your comments and suggestions will encourage us. Keep visiting us.
*****Update*****
How to Speed Up Your Website Part-II




{ 10 comments… read them below or add one }
Your guide is awesome and my site is now loading 40% faster. I checked the the suggestions and found that images are not compressed. Same is the case with PDF files. Why we have excluded these from compression.
Your question is well answered in the artilce. Main reason is , images are already in compressed format. nad if you compress PDF files, you will have problem while reading PDF files in Browser. Try yourself the PDF file problem and let us know, what was the result.
That was great Imran. Gzip compression contains the information like file size, file name, contents of file, checksum etc. Though checksum is important feature of Gzip compression. While Deflate is totally RAW compression.
You are right Robb, thats why Deflate is faster than gzip. And is taking benefit from modern processors. Its is very fast on C2D.
I have a lot of flash clips on my site. is there any way i can save my disk space.
Seriously, your article is very well explain… I already know the trick, but I tought that all browser even MSIE was able to support it.
Thanks for the precision.
Twitter: bloggingjunkie
March 7, 2010 at 9:35 pm
Thank You for your comment. As far as browser support is concerned, i was talking about old versions of browsers. Keep visiting and leave comments.
I really like when people are expressing their opinion and thought. So I like the way you are writing
Twitter: moblox1
July 11, 2010 at 4:42 am
Unfortunately those deflate codes didn’t work on my webhost byethost.com. It bring me to an internal server error page.
Twitter: bloggingjunkie
July 11, 2010 at 8:41 am
So it means Mod_deflate module is not running on your server which is very strange. In my opinion, talk to your hosting provider on this issues and have their opinion. mod_deflate or gzip modules save bandwidth. talk to them and may be gzip is working as alternative.
{ 12 trackbacks }