Main Menu
Home
About
Archive
Zen Kernel
Downloads
Satellite
Dish Keys
SURGE
Links
Search
Search Bible
Feed Me!
 

 Subscribe

Add to Google

Add to Pageflakes

Subscribe in Bloglines

Add to My AOL



 




Top Technology blogs




Make Your Website Fast
Friday, 01 June 2007
The sad fact of the matter is that there are still many people using Dialup, even today. Considering that the languages and techniques applied in modern web design are bigger than those of the days of old (in general), it makes it hard on this large population of Dialup users. This is my reasoning for staying away (as much as possible) from Ajax, as well as any unneccessary Java or flash content. I still do all the tweaking I can to make my site fast, not just for broadband users, but for everyone who visits.

How do I do this? First, you need a good host. Hosting aside, an important step is to look at the code involved in your template files, assuming you are using a Content Management System. Clean up the PHP code. Remove comments you don't need, remove code that doesn't do anything, do everything you can to make the code clean, small and efficient. As for your CSS, remove any unneeded style information, and run it through a CSS compressor, such as this one. Then, if you have gzip enabled on your site, add the following to the top of your CSS file(s):

<?php ob_start ("ob_gzhandler");
header("Content-type: text/css");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);?>

Rename the CSS extensions to .php (ex. template.css -> template.php), and change all of the references to the CSS in your PHP files to point to the renamed files. This should considerably speed up loading time.

Assuming that you have access to a program capable (I just use Photoshop) you should make sure your images are as small as they possibly can be. Photoshop has a great function under the file menu, "Save for Web." This allows us to choose many options to make sure our image looks great, yet is still very small. For multicolor images, like my logo, I used the high quality JPG compressor, and played around with the quality slider until I had the right balance of compression and quality. As for images that don't have many colors, like the backgrounds on my menu headers (the green rounded corner box things) I chose the GIF file format, and restricted them to only two colors, white and the green color. Play around with the image settings until you get good quality with the highest possible compression.

If you use a MySQL database, you should on occasion log in, and remove any tables from uninstalled components to your CMS, and remove any other junk that you don't use. Following that, select all of your tables, and use the optomize command to make sure they are all in good working order.

Now comes the most important part: caching. Caching can dramatically speed up (90% in some cases) page load times. For my CMS, Joomla, I use a component called Page Cache, by Ircmaxwell, which is amazing. After one hit on any page in my site, I have the component set to keep a cached copy of the page for 24 hours. The component can use the Database to store the cached information, or use APC. Similar plugins and addons are available, such as WP-Cache for Wordpress, and many CMS'es already have the feature built-in.

Finally, if you feel brave, or have a webhost that has it preinstalled, a product like eAccelerator or APC is always a good idea. They both optomize, accelerate, and dynamically cache PHP, thus adding even more speed. I personally haven't gotten this far, as my loading times are fine, and I don't feel like recompiling PHP, but to each his or her own.

That said, go make your site fast, so that poor dialup users (like me when I am at home!) can easily browse it!


Comments
Add New RSS
Write comment
Name:
Email:
 
Website:
Title:
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.25 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 

© Matt Parnell's Brain: Plugged In!