How Can I Optimize My Bandwidth
From LoveToKnow Web-Design
Since website bandwidth can be expensive, every webmaster asks the question "How can I optimize my bandwidth?"
Images and Files
Many web hosting accounts place limits on website bandwidth, so webmasters typically use various techniques to make the best use out of the bandwidth they currently have. These techniques will not only increase bandwidth efficiency, but they also help to make web pages load much more quickly.
Images, videos, and any other files that get downloaded from your website use the most bandwidth. One of the most effective ways to reduce your overall bandwidth consumption is to deal with these files more efficiently.
Use Compressed Images or No Images
Images can consume bandwidth at a factor of four to five times the bandwidth of a single text web page. However, several techniques can help prevent these files from consuming a large portion of your monthly bandwidth limit.
- Background image: Avoid using an image as a background. Instead, set the HTML background color property in the body tag to the color you'd like the background to be. Or use CSS (Cascading Style Sheets) to set the background style.
- Compress images: If you do use images, make sure to compress them to the smallest size possible. Shrink the size of a photo down by adjusting resolution and physical dimension. You can easily cut a 200kb image down to 50kb, which will cut the bandwidth used by this image down by 75 percent.
To Hotlink or not to Hotlink?
Hotlinking is defined as creating a link to a file, image, video, or other downloadable content that gets displayed on one website but is downloaded from another.
This can be an inline image that gets displayed directly on a web page, or it can be a simple link.
- Disable hotlinking: One unethical technique other webmasters use to reduce their own image bandwidth is to place an "inline image link" in their website which displays the image on their webpage, but loads it from your server. This technique is known as "bandwidth theft" and is frowned upon. Make sure people don't steal your bandwidth by editing the .htaccess file on your hosting account.
- Host your files elsewhere: While "bandwidth theft" is unethical, there is a similar technique that is perfectly okay. Hosting your images or large downloadable files on hosting sites such as Rapidshare allows you to place inline image links in your web page. This will display the image, or allow users to download the file, but it won't affect your bandwidth at all.
Keep the ALT and TITLE Short
Keep in mind when writing alternate and title text into your "img" tag that every character you type adds about one byte to the size of the web page file. The shorter you keep this description, the smaller your web page file will be, and the less bandwidth it will take each time a user loads the page. While this may not seem to represent a great deal of bandwidth savings, over a hundred or so pages, the savings can add up.
Web Page Design
There are various things you can do while designing a web page that will drastically reduce the overall bandwidth requirements of your site. These items include HTML design, CSS design, and file compression.
Using Cascading Style Sheets
While there are aspects of CSS that will help you to write less code to create more web pages, the CSS files themselves can sometimes be rather large. Additionally the formatting of CSS files contains many spaces and formatting that only serves to add to the size of the file.
- Compress CSS files: Because there are is a great deal of useless formatting inside CSS files, a good method to reduce the size of these files is to compress them using any number of CSS compressor programs. One example is the [www.arantius.com Arantius] javascript compressor, a free CSS compression tool.
- Avoid using tables: A new technique webmasters are now using to drastically reduce the size of HTML files is avoiding using tables whenever possible. Tables typically require formatting that takes up a lot of file space, so a new technique webmasters use is to make use of "DIV" or "SPAN" in combination with CSS code to perform the same page formatting functions which webmasters used to use the "TABLE" tag for.
Reduce Size if HTML Files
While HTML files are usually significantly smaller than image files or other content, webmasters can sometimes inadvertently program additional size into the web page code that can eat away at the monthly bandwidth limit. There are several techniques you can use to make sure that your HTML code is written as efficiently as possible so that you can optimize your bandwidth. When you ask yourself "How can I optimize my bandwidth?" - HTML efficiency is one answer.
- Compress HTML files: Gzip is a popular data compression utility that can trim down wasted space within HTML files a great deal. GZip is free software and can reduce the size of all of your HTML files to a point where they are as bandwidth efficient as possible.
- Avoid commenting: While most good programmers will tell you that a well written program is always well commented, when it comes to optimizing bandwidth, the opposite is true. The smaller your HTML file size is, the lower your bandwidth will be.
- Link efficiently: With HTML, the fewer characters used, the smaller your filesize will be. Another good technique to reduce character count is to cut down how you link to your own files. For example, instead of linking to an image with "http://www.mypage.com/images/folder1/subfolder2/img.jpg", you should organize images in to folders closer to the root directly, and refer to them with shorter links referenced from root, like "/images/img.jpg".
When Bandwidth Limits You too Much
For websites that have a membership or are very new, bandwidth considerations usually aren't an issue. However as websites grow, bandwidth quickly becomes a major concern. If all of the techniques listed above do not help reduce bandwidth below your monthly limit, it may be time to consider upgrading your hosting account to a higher bandwidth (or unlimited bandwidth) in order to accommodate the popularity of your website.
Learn More
This page has been accessed 373 times. This page was last modified 05:04, 6 July 2008.
© 2006-2008 LoveToKnow Corp.
