O'Reilly logo

ASP.NET Site Performance Secrets by Matt Perdeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Improving the compressibility of your pages

If your server uses compression, then it makes sense to optimize compressibility of your text files. Compression algorithms like repeating content, which puts a premium on consistency:

  • Always specify HTML attributes in the same order. One way to achieve this is to have all your HTML generated by high-level web controls and custom server controls, instead of low-level HTML server controls. This will slightly increase CPU usage, but will give you assured consistency. For example, write the following:
    <asp:Hyperlink runat= server ......>
    

    Instead of the following:

    <a runat="server" .... >
    
  • Likewise, within CSS selectors, write your properties in alphabetical order.
  • Use consistent casing. Use all lowercase for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required