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

Avoid unnecessary processing

You don't want to spend a lot of CPU cycles doing work that isn't needed. Here are some ways to avoid that:

  • Validate early. Make sure you have all the data you need in the correct form before spending resources processing the data. If you're going to fail, fail early.
  • Check whether the visitor is still connected before doing expensive processing. You can do this by checking Response.IsClientConnected.
  • Check Page.IsPostBack, so that you won't regenerate data that you already have in ViewState.

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