ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> ASP Render blocks --> Part 2

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
166 active users
10237 visitors today
11076 pages today
how is this done?
ASP.NET Showcase
ASP.NET Graph and Chart Component with FREE developer version

ASP.NET Shopping Cart and E-commerce Control with FREE trial download

ASP.NET Web Hosting with free month and setup

$15 Domain Name Registration from .DNR.
As seen on these sites
Special thanks go to the sites that support me by publishing my articles.
See more

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
ASPRSS
ShawThing

Now open source with SourceForge!

Wasting Bandwidth

You see how the file above is nicely formatted - the <title> tag is indented from the <head> tag? You need to do that when you're coding to make the code easily readable, and hence maintainable.

But you're punishing your users unnecessarily! They have to download your extra line feeds and tabs, when their browser could care less that they are there. The file below renders exactly the same:

<%@ Language=JavaScript %>
<html><head><title>My page</title></head><body>We're in "HTML mode" here...
<%
   var sScript = Request.ServerVariables ( "SCRIPT_NAME" );

   Response.Write ( '<p>I am called ' + sScript + '<p>' );
%>
...and here.</body></html>

So, the user is now happier because your page loads faster. If you don't think this matters much do a View/Source on some major sites and see the extra baggage they send out. Remove the HTML comments and the extra spaces/tabs and you'll be surprised how much quicker they download.

I did this exercise on a page generated with FrontPage. It started out as a 40k file - that's a sizeable page to download at 28.8kb. I removed the indentation (which were all spaces) and the HTML comments and the page reduced to 3k. The browser didn't render anything differently, just 10 times quicker!

Part 3: Readability...

Featured sponsor
My favorite resources

Selling products online - read how James does it now



See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!


New Proposal Kit Professional 5.1
Brand yourself as a top professional: create quotes and amazing proposals and get many legal documents free!

The latter saved me 3 times the purchase price on the first day I owned it!