Tip: Using Prerender and Prefetch directives in HTML pages to improve ASP.NET web application performance

Posted: (EET/GMT+2)

 

Today's post is a quick tip for ASP.NET web application development and speeding up the loading of different pages and resources so that the "next page" would show on the user's screen as fast as possible.

The IE browser supports two features in the W3C working draft called Resource Hints. The idea is to let the browser do some operations before the user decides to navigate to the "next" page. Usually, in many web applications, there's certain flow, through which the user navigates in the site. If you can guess the user's next page with some probability, you can instruct the browser to pre-load or even pre-render the next page. This can save plenty of time.

These directives are part of the HTML code, and can look like this:

<link rel="prerender" href="http://www.mysite.com/app/stuff/nextpage " />
<link rel="prefetch" href="http://www.mysite.com/app/content/style.css" />

There's a good documentation page on MSDN about these two options: prerender and prefetch.

Hope this helps!