Optimize ASP.NET presentation

Oct 18, 2011
At //build and today at VS Live I gave a talk about performance optimizing ASP.NET web applications using bundling, minification and other cool tricks. See the video presentation The Visual Studio 2010 extension I used were:Web Essentials Image Optimizer Web Standards Update The demo website can now be downloaded here. It runs in ASP.NET 4.0 Optimize Website.zip (4.39 mb)

Prepare web.config for HTML5 and CSS3

Dec 1, 2010
HTML5 and CSS3 introduces some new file types that enables us to create even better websites. We are now able to embed video, audio and custom fonts natively to any web page. Some of these file types are relatively new and not supported by the IIS web server by default. It’s file types like .m4v, .webm and .woff. When a request is made to the IIS for these unsupported file types, we are met with the following error message: HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. The problem is that the IIS doesn’t know how to serve these new files unless we tell it how. This can be easily done in the web.config’s <system.webServer> section by adding the following snippet: <staticContent> <mimeMap fileExtension=".mp4" mimeType="video/mp4" /> <mimeMap fileExtension=".m4v" mimeType="video/m4v" /> <mimeMap fileExtension=".ogg" mimeType="video/ogg" /> <mimeMap fileExtension=".ogv" mimeType="video/ogg" /> <mimeMap fileExtension=".webm" mimeType="video/webm" /> <mimeMap fileExtension=".oga" mimeType="audio/ogg" /> <mimeMap fileExtension=".spx" mimeType="audio/ogg" /> <mimeMap fileExtension=".svg" mimeType="images/svg+xml" /> <mimeMap fileExtension=".svgz" mimeType="images/svg+xml" /> <remove fileExtension=".eot" /> <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" /> <mimeMap fileExtension=".otf" mimeType="font/otf" /> <mimeMap fileExtension=".woff" mimeType="font/x-woff" /></staticContent>.csharpcode, .csharpcode pre {font-size: small;color: black;font-family: consolas, "Courier New", courier, monospace;background-color: #ffffff;/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;} .csharpcode .lnum { color: #606060; }The above snippet includes support for most video, audio and font file types used by HTML5 and CSS3.

Get last-modified header from response in ASP.NET

May 21, 2009
A quick and dirty method for retrieving the last-modified date of a HTTP response in ASP.NET [More]

Add support for iPhone in ASP.NET

Apr 12, 2009
How to easily utilize a few cool capabilities of the iPhone and iPod in your own ASP.NET website. [More]

Checklist for high quality websites part 1

Jan 13, 2009
A checklist for websites [More]

Localize text in JavaScript files in ASP.NET

Aug 21, 2008
Use a simple HTTP handler to localize your .js script files [More]

Status 500 errors when doing HTTP requests

Aug 10, 2008
Create a web request with the correct headers to avoid status 500 errors [More]

The method you didn’t know you needed

Mar 15, 2008
Display relative time to the end-user instead of precise to-the-second time [More]

Tip: Regex.Escape

Mar 4, 2008
An easy way to escape strings passed on to regular expressions. [More]

Make your blog talk

Nov 29, 2007
How to automatically and free have offer a narrated version of your blog. [More]

About the author

Mads Kristensen

Mads Kristensen
Program Manager at the Microsoft Web Platform team and founder of BlogEngine.NET.

More...

Month List

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.