Search Wiki:

Why FastMVC?

    • Load dynamic pages 5 to 20 times faster by compressing response on the fly
    • Serve static files (js, html, css) 10 to 100 times faster by compressing and caching their content
    • Improve repeated site load time by maximizing caching on browser

Problem

There are several problems with ASP.NET MVC application when deployed on IIS 6.0:

    • Extensionless URLs give 404 unless some URL Rewrite module is used or wildcard mapping is enabled
    • IIS 6.0 built-in compression does not work for dynamic requests. As a result, ASP.NET pages are served uncompressed resulting in poor site load speed.
    • Mapping wildcard extension to ASP.NET introduces the following problems:
      • Slow performance as all static files get handled by ASP.NET and ASP.NET reads the file from file system on every call
      • Expires headers doesn't work for static content as IIS does not serve them anymore. Learn about benefits of expires header from here. ASP.NET serves a fixed expires header that makes content expire in a day.
      • Cache-Control header does not produce max-age properly and thus caching does not work as expected. Learn about caching best practices from here.
      • After deploying on a domain as the root site, the homepage produces HTTP 404.

Solution

We need to write a custom static file handler that will cache small files like images, Javascripts, CSS, HTML and so on in ASP.NET cache and serve the files directly from cache instead of hitting the disk. Here are the steps:

    • Install an HttpModule that installs a Compression Stream on Response.Filter so that anything written on Response gets compressed. This serves dynamic requests.
    • Replace ASP.NET's DefaultHttpHandler that listens on . for static files.
    • Write our own Http Handler that will deliver compressed response for static resources like Javascript, CSS, and HTML.

Download the latest code from "Downloads" tab

Read on

Read details about this on my blog:

http://msmvps.com/blogs/omar
Last edited Jun 30 2008 at 11:01 AM  by oazabir, version 6
Updating...
Page view tracker