Use script includes for any static scripts in your page to
enable the client to cache these scripts for subsequent requests. The following
script element shows how to do this.
Listing 5
<script language=jscript src="scripts\myscript.js">
Remove characters such as tabs and spaces that create white
space before you send a response to the client. Removing white spaces can
dramatically reduce the size of your pages. The following sample table contains
white spaces.
Listing 6
// with white space
<table>
<tr>
<td>hello</td>
<td>world</td>
</tr>
</table>
The following sample table does not contain white spaces.
Listing 7
// without white space
<table>
<tr><td>hello</td><td>world</td></tr>
</table>
In an Internet scenario that involves slow clients, removing
white space can increase response times dramatically.
·
Limit the use of graphics, and consider using compressed
graphics.
·
Consider using cascading style sheets to avoid sending the same
formatting directives to the client repeatedly.
·
Avoid long control names; especially ones that are repeated in a
DataGrid or Repeater control. Control names are used to generate unique HTML ID
names. A 10-character control name can easily turn into 30 to 40 characters
when it is used inside nested controls that are repeated.