![]() | ||||||
Customer Login About Us Ask A Question Software Catalog eBooks & Courses DNN Catalog Farewell Package Forums Bespoke Software Useful Links Customer Reviews ClickBank Search Articles Privacy Policy | Improving web page performanceBy Roger Willcocks One of the most common causes of visitors leaving a web site, is a slow loading page. As a general rule, people assume that how fast a page displays is dependent purely on how big the page is. That is not entirely the case, and this article is going to discuss what the various causes are, and how you can take advantage of common tools in order improve your web site's performance. Factors affecting page display
The four main functions that this break down into are:
These processes are handled by three parts of the web browser. The receiver takes care of the first two. The parser takes care of the third. and the renderer displays the result on the screen. Take your WYSIWYG editor, and throw it awayMaybe a little extreme? Not quite. If you have an HTML editor that is over 3 years old [eg FrontPage 2000], you would be better off throwing it away and writing pages in a text editor. It's easy. And here's why you should do it, below are before and after examples of a piece of HTML produced by FrontPage, and then manually cleaned up: BEFORE: <td><span style="text-align:center;font-weight:bold;background-colour:#CCCCCC;"> <span style="text-align:center;font-weight:bold;background-colour:#CCCCCC;"> <span style="text-align:center;font-weight:bold;background-colour:#CCCCCC;">Quantity<span><span><span><td> CLEANED: <th style="background-colour:#CCCCCC;">Quantity<th> STYLESHEET: <th class="tablesubheading;">Quantity<th> Between the first and last version, we threw away around two thirds of the generated HTML. In many cases, you can reduce the size of a WYSIWYG edited page by 40% to 60% simply by cleaning it up. Your basic problem with WYSIWYG editors is a lack of control, and for best results, you need control Clean up redundant tagsThe previous example showed one form of redundant tag, the same tag repeated multiple times, with no net effect. There are other similar patterns, such as <b></b>, a pair of tags with nothing inside them. All these add size to the page, and extra work to the renderer. Make sure HTML tags are correctly orderedTo avoid processing issues, make sure your tags follow the LIFO rule [Last In First Out]. For example: <span><b>My text</span></b> would cause a web browser to either
read ahead in order to make a decision, or internally convert it into Again, more tags, and more work for the renderer to do. If you have existing pages you'd like to clean up, there is a free tool available. Learn to use style sheetsStyle sheets [CSS] allow you to apply the same formatting to an entire web site. Make a change in one place, and it appears everywhere at once. It gets downloaded ONCE for the web site, thereby saving download time. And it makes it much easier to read and edit your HTML documents. Once you understand how to use stylesheets, and how to put together the HEAD section of an HTML page, you can write the entire body of the document using text, and an understanding of the follow tags:
Apply a DOCTYPE declaration to your pagesWhat is a DOCTYPE? A line at the start of your page that tells the web browser what sort of page it is. In common usage, it declares which HTML standard is being used. This web site uses XHTML Strict 1.0, and MOSTLY complies with it. The one area I consistently break with it is that the Strict declaration does not support the target attribute on hyperlinks. There are many different DOCTYPEs, over 10. I suggest you pick one between HTML 3.2, and XHTML 1.0. Most editors support 4.01 Transitional by default. You can find out more about the different DOCTYPEs at the W3C website, which is an excellent resource for telling you how the web is SUPPOSED to work. Unfortunately, Microsoft and every other browser creator has slightly different interpretations, though they are getting much better at consistency these days. Now that you've selected a document type, STICK TO IT. A document type allows a web browser to make certain assumptions about how a document is structured, and that means it has a much easier time rendering it. What happens if I have no doctype? What happens if the doctype doesn't match the content? Validate your HTML What do you mean validate? Validating your HTML means that it is clearer, more consistent, easier to maintain, and more easily understood by the reader applications used by people with visual disabilities. I have left some deliberate errors in this article so you can see the results of the validation test for this page. Activate compression on your web siteThe HTTP 1.1 standard supports a variety of data compression standards, which any vaguely new [post 1995] web browser supports. This basically allows a file to be 'zipped' or otherwise compressed before being sent, and unzipped by the browser before it is shown to the user. The intention of this is to decrease the amount of data that needs to be transferred over the network, leading to faster download times. This functionality is provided is most web servers for static [html] pages, but may not be turned on. For dynamic pages, you may need specific software enabled for the web site. For ASP.NET, you can use Bandwidth buddy, there are others available for IIS, Apache, and other major web servers. So what are the benefits?More than you expect. If you simply put up a site and leave it, some of these benefits won't interest you, but others will
|
| ||||
Home | Login | About | Contact | Catalog | eBooks | DNN Catalog | MJFP | Forums | Bespoke | Links | Reviews | CB Search | Articles
| ||||||