다음을 통해 공유


Best Practices for Creating Efficient Sites

Applies To: Windows Server 2003, Windows Server 2003 with SP1

The following best practices can help you improve the efficiency of important, often-used Web pages.

Optimize settings

  • Set file expiration dates. By setting future expiration dates on each file at the IIS server, you can reduce second-access load times by 50 to 70 percent.

  • Enable HTTP Keep-Alives in IIS.

  • Author hyperlinks consistently because the Internet Explorer cache is case sensitive.

  • Use cache-control extensions. Internet Explorer version 5 introduced support for two extensions to the cache-control HTTP response header: pre-check and post-check.

  • Enable HTTP compression to increase efficiency of bandwidth use.

Use design elements judiciously

  • Standardize images. For example, if your site uses two images that are slightly different from each other, either in size, color, or design, standardize to a single image.

  • Reduce Graphics Interchange Format (GIF) image color depth or consider using Portable Network Graphics (PNG) format.

  • Eliminate unnecessary images that appear below the scroll bar. Users view these images less frequently; so weigh their value against their performance cost. For example, use text rather than images for arrows, lines, and bullets. Incorporate several small images into one large graphic (or remove some of the images). Substitute smaller images for large ones.

  • Use the most compact graphics format that supports the quality of image that you need. Images saved as a file type that is inherently large, such as a Tagged Image File Format (.tif), can increase download times; consider substituting a more compact format such as a Graphics Interchange Format (.gif) or a Joint Photographic Experts Group (.jpg) file. You might also consider compressing existing images.

Ensure that developers design scripts and code that load quickly

  • Reduce clutter. Space characters, tabs, and remarks often consume more than 20 percent of an .htm or an .asp file. Delete this clutter before you load the files on production servers.

  • Remove redundant tags. Consider using arrays to fill drop-down lists instead of repeating [<Option Value = data> data</Option>] again and again.

  • Use JavaScript (.js) files to consolidate commonly used scripts.

  • Reduce the number of small files. Build whole images instead of multiple component images. For tabs, use a single image map.

  • Consolidate multiple images and adjacent images into a single file.

  • Do not use nested <table> tags.

Test load times for your pages

You can use the following tools to test the load times for your Web pages:

  • WAN simulators

  • Network Monitor

  • Load simulators for the Internet environment

  • Reporting tools