<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://code.msdn.microsoft.com/rss.xsl"?><rss version="2.0"><channel><title>FastMVC: Compress and Cache Dynamic and Static requests</title><link>http://code.msdn.microsoft.com/fastmvc/Project/ProjectRss.aspx</link><description>Load dynamic pages 5 to 20 times faster by compressing response on the fly.    Serve static files &amp;#40;js, html, css&amp;#41; 10 to 100 times faster by compressing and caching their content.    Improve repeated si...</description><item><title>NEW POST: .swf flash component not getting loaded by trying this</title><link>http://code.msdn.microsoft.com/fastmvc/Thread/View.aspx?ThreadId=1827</link><description>&lt;div class="wikidoc"&gt;
Hi!&lt;br /&gt;I tried this, the output is good, but only one problem i have is the Flash component are not getting loaded.&lt;br /&gt;It only shows the empty block and when I right click on it, it shows &amp;quot;not loaded&amp;quot;. But If I Remove both the .cs files and run the application without compression, the flash gets displayed.&lt;br /&gt;So is there any more work to do this?&lt;br /&gt;
&lt;/div&gt;</description><author>hrdksanghavi</author><pubDate>Wed, 03 Jun 2009 12:00:54 GMT</pubDate><guid isPermaLink="false">NEW POST: .swf flash component not getting loaded by trying this 20090603P</guid></item><item><title>NEW POST: Will this work for plain asp.net webform applications??</title><link>http://code.msdn.microsoft.com/fastmvc/Thread/View.aspx?ThreadId=1472</link><description>&lt;div class="wikidoc"&gt;
I was planning to implement something like this in my asp.net application. Will this http module work for plain asp.net webform applications??&lt;br /&gt;
&lt;/div&gt;</description><author>ajitgoel</author><pubDate>Mon, 23 Mar 2009 02:59:56 GMT</pubDate><guid isPermaLink="false">NEW POST: Will this work for plain asp.net webform applications?? 20090323A</guid></item><item><title>NEW POST: Duplicating existing code</title><link>http://code.msdn.microsoft.com/fastmvc/Thread/View.aspx?ThreadId=1388</link><description>&lt;div class="wikidoc"&gt;
I believe you are looking for this method:&lt;br /&gt; &lt;br /&gt;        private static string MimeType(string fileName)&lt;br /&gt;        {&lt;br /&gt;            FileInfo fileInfo = new FileInfo(fileName);&lt;br /&gt;            string fileExtension = fileInfo.Extension.ToLower();&lt;br /&gt; &lt;br /&gt;            string cacheKey = &amp;quot;MimeTypeFor&amp;quot; + fileExtension;&lt;br /&gt;            object cachedValue = HttpRuntime.Cache.Get(cacheKey);&lt;br /&gt;            if (cachedValue != null)&lt;br /&gt;                return (string)cachedValue;&lt;br /&gt; &lt;br /&gt;            string mime = &amp;quot;application/octetstream&amp;quot;;&lt;br /&gt;            Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(fileInfo.Extension.ToLower());&lt;br /&gt;            if (rk != null &amp;amp;&amp;amp; rk.GetValue(&amp;quot;Content Type&amp;quot;) != null)&lt;br /&gt;                mime = rk.GetValue(&amp;quot;Content Type&amp;quot;).ToString();&lt;br /&gt; &lt;br /&gt;            HttpRuntime.Cache.Add(&lt;br /&gt;                cacheKey,&lt;br /&gt;                mime,&lt;br /&gt;                null,&lt;br /&gt;                //TODO: ideally we should have a dependency on the web.config file to refresh the cache when modified&lt;br /&gt;                System.Web.Caching.Cache.NoAbsoluteExpiration,&lt;br /&gt;                new TimeSpan(0, 20, 0),&lt;br /&gt;                System.Web.Caching.CacheItemPriority.Normal,&lt;br /&gt;                null);&lt;br /&gt; &lt;br /&gt;            return mime;&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Regards&lt;br /&gt;  Taliesin&lt;br /&gt;
&lt;/div&gt;</description><author>taliesins</author><pubDate>Tue, 17 Mar 2009 10:07:35 GMT</pubDate><guid isPermaLink="false">NEW POST: Duplicating existing code 20090317A</guid></item><item><title>NEW POST: Duplicating existing code</title><link>http://code.msdn.microsoft.com/fastmvc/Thread/View.aspx?ThreadId=1388</link><description>&lt;div class="wikidoc"&gt;
It seems that &lt;b&gt;all your code is duplicating existing code in IIS or in ASP.NET&lt;/b&gt;. I mean, you even have your own list of MIME types! It's a lot of code to accomplish a simple task. &lt;br /&gt; &lt;br /&gt;Is there &lt;i&gt;really&lt;/i&gt; no way to leverage existing code instead of brewing all this own?&lt;br /&gt;
&lt;/div&gt;</description><author>ndsm</author><pubDate>Fri, 27 Feb 2009 09:26:15 GMT</pubDate><guid isPermaLink="false">NEW POST: Duplicating existing code 20090227A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=Home&amp;version=6</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Why FastMVC?
&lt;/h1&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Load dynamic pages 5 to 20 times faster by compressing response on the fly&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Serve static files (js, html, css) 10 to 100 times faster by compressing and caching their content&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Improve repeated site load time by maximizing caching on browser&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h1&gt;
Problem
&lt;/h1&gt;There are several problems with ASP.NET MVC application when deployed on IIS 6.0:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Extensionless URLs give 404 unless some URL Rewrite module is used or wildcard mapping is enabled &lt;/li&gt;&lt;li&gt;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. &lt;/li&gt;&lt;li&gt;Mapping wildcard extension to ASP.NET introduces the following problems: &lt;/li&gt;&lt;ul&gt;
&lt;li&gt;Slow performance as all static files get handled by ASP.NET and ASP.NET reads the file from file system on every call&lt;/li&gt;&lt;li&gt;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.&lt;/li&gt;&lt;li&gt;Cache-Control header does not produce max-age properly and thus caching does not work as expected. Learn about caching best practices from here. &lt;/li&gt;&lt;li&gt;After deploying on a domain as the root site, the homepage produces HTTP 404.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h1&gt;
Solution
&lt;/h1&gt;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:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Install an HttpModule that installs a Compression Stream on Response.Filter so that anything written on Response gets compressed. This serves dynamic requests.&lt;/li&gt;&lt;li&gt;Replace ASP.NET's DefaultHttpHandler that listens on &lt;b&gt;.&lt;/b&gt; for static files.&lt;/li&gt;&lt;li&gt;Write our own Http Handler that will deliver compressed response for static resources like Javascript, CSS, and HTML. &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;b&gt;Download the latest code from &amp;quot;Downloads&amp;quot; tab&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Read on
&lt;/h1&gt;Read details about this on my blog:&lt;br /&gt; &lt;br /&gt;&lt;a href="http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=http%3a%2f%2fmsmvps.com%2fblogs%2fomar&amp;amp;referringTitle=Home"&gt;http://msmvps.com/blogs/omar&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>oazabir</author><pubDate>Mon, 30 Jun 2008 11:01:21 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080630A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=Home&amp;version=5</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Why FastMVC?
&lt;/h1&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Load dynamic pages 5 to 20 times faster by compressing response on the fly&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Serve static files (js, html, css) 10 to 100 times faster by compressing and caching their content&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Improve repeated site load time by maximizing caching on browser&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h1&gt;
Problem
&lt;/h1&gt;There are several problems with ASP.NET MVC application when deployed on IIS 6.0:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Extensionless URLs give 404 unless some URL Rewrite module is used or wildcard mapping is enabled &lt;/li&gt;&lt;li&gt;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. &lt;/li&gt;&lt;li&gt;Mapping wildcard extension to ASP.NET introduces the following problems: &lt;/li&gt;&lt;ul&gt;
&lt;li&gt;Slow performance as all static files get handled by ASP.NET and ASP.NET reads the file from file system on every call&lt;/li&gt;&lt;li&gt;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.&lt;/li&gt;&lt;li&gt;Cache-Control header does not produce max-age properly and thus caching does not work as expected. Learn about caching best practices from here. &lt;/li&gt;&lt;li&gt;After deploying on a domain as the root site, the homepage produces HTTP 404.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h1&gt;
Solution
&lt;/h1&gt;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:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Install an HttpModule that installs a Compression Stream on Response.Filter so that anything written on Response gets compressed. This serves dynamic requests.&lt;/li&gt;&lt;li&gt;Replace ASP.NET's DefaultHttpHandler that listens on &lt;b&gt;.&lt;/b&gt; for static files.&lt;/li&gt;&lt;li&gt;Write our own Http Handler that will deliver compressed response for static resources like Javascript, CSS, and HTML. &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h1&gt;
Read on
&lt;/h1&gt;Read details about this on my blog:&lt;br /&gt; &lt;br /&gt;&lt;a href="http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=http%3a%2f%2fmsmvps.com%2fblogs%2fomar&amp;amp;referringTitle=Home"&gt;http://msmvps.com/blogs/omar&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>oazabir</author><pubDate>Mon, 30 Jun 2008 11:00:01 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080630A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=Home&amp;version=4</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Why FastMVC? !
&lt;/h1&gt;&lt;b&gt;Load dynamic pages 5 to 20 times faster by compressing response on the fly&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Serve static files (js, html, css) 10 to 100 times faster by compressing and caching their content&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Improve repeated site load time by maximizing caching on browser&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Problem !
&lt;/h1&gt;There are several problems with ASP.NET MVC application when deployed on IIS 6.0:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Extensionless URLs give 404 unless some URL Rewrite module is used or wildcard mapping is enabled &lt;/li&gt;&lt;li&gt;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. &lt;/li&gt;&lt;li&gt;Mapping wildcard extension to ASP.NET introduces the following problems: &lt;/li&gt;&lt;ul&gt;
&lt;li&gt;Slow performance as all static files get handled by ASP.NET and ASP.NET reads the file from file system on every call&lt;/li&gt;&lt;li&gt;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.&lt;/li&gt;&lt;li&gt;Cache-Control header does not produce max-age properly and thus caching does not work as expected. Learn about caching best practices from here. &lt;/li&gt;&lt;li&gt;After deploying on a domain as the root site, the homepage produces HTTP 404.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h1&gt;
Solution !
&lt;/h1&gt;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:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Install an HttpModule that installs a Compression Stream on Response.Filter so that anything written on Response gets compressed. This serves dynamic requests.&lt;/li&gt;&lt;li&gt;Replace ASP.NET's DefaultHttpHandler that listens on &lt;b&gt;.&lt;/b&gt; for static files.&lt;/li&gt;&lt;li&gt;Write our own Http Handler that will deliver compressed response for static resources like Javascript, CSS, and HTML. &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h1&gt;
Read on !
&lt;/h1&gt;Read details about this on my blog:&lt;br /&gt; &lt;br /&gt;&lt;a href="http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=http%3a%2f%2fmsmvps.com%2fblogs%2fomar&amp;amp;referringTitle=Home"&gt;http://msmvps.com/blogs/omar&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>oazabir</author><pubDate>Mon, 30 Jun 2008 10:59:18 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080630A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=Home&amp;version=3</link><description>&lt;div class="wikidoc"&gt;
!Why FastMVC?!&lt;br /&gt;&lt;b&gt;Load dynamic pages 5 to 20 times faster by compressing response on the fly&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Serve static files (js, html, css) 10 to 100 times faster by compressing and caching their content&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Improve repeated site load time by maximizing caching on browser&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;!Problem!&lt;br /&gt;There are several problems with ASP.NET MVC application when deployed on IIS 6.0:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Extensionless URLs give 404 unless some URL Rewrite module is used or wildcard mapping is enabled &lt;/li&gt;&lt;li&gt;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. &lt;/li&gt;&lt;li&gt;Mapping wildcard extension to ASP.NET introduces the following problems: &lt;/li&gt;&lt;ul&gt;
&lt;li&gt;Slow performance as all static files get handled by ASP.NET and ASP.NET reads the file from file system on every call&lt;/li&gt;&lt;li&gt;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.&lt;/li&gt;&lt;li&gt;Cache-Control header does not produce max-age properly and thus caching does not work as expected. Learn about caching best practices from here. &lt;/li&gt;&lt;li&gt;After deploying on a domain as the root site, the homepage produces HTTP 404.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;!Solution!&lt;br /&gt;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:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Install an HttpModule that installs a Compression Stream on Response.Filter so that anything written on Response gets compressed. This serves dynamic requests.&lt;/li&gt;&lt;li&gt;Replace ASP.NET's DefaultHttpHandler that listens on &lt;b&gt;.&lt;/b&gt; for static files.&lt;/li&gt;&lt;li&gt;Write our own Http Handler that will deliver compressed response for static resources like Javascript, CSS, and HTML. &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;!Read on!&lt;br /&gt;Read details about this on my blog:&lt;br /&gt; &lt;br /&gt;&lt;a href="http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=http%3a%2f%2fmsmvps.com%2fblogs%2fomar&amp;amp;referringTitle=Home"&gt;http://msmvps.com/blogs/omar&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>oazabir</author><pubDate>Mon, 30 Jun 2008 10:58:41 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080630A</guid></item><item><title>CREATED RELEASE: Version 1.0 (Jun 30, 2008)</title><link>http://code.msdn.microsoft.com/fastmvc/Release/ProjectReleases.aspx?ReleaseId=1226</link><description></description><author></author><pubDate>Mon, 30 Jun 2008 10:55:40 GMT</pubDate><guid isPermaLink="false">CREATED RELEASE: Version 1.0 (Jun 30, 2008) 20080630A</guid></item><item><title>UPDATED WIKI: Home</title><link>http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=Home&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Problem&lt;/b&gt;&lt;br /&gt;There are several problems with ASP.NET MVC application when deployed on IIS 6.0:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Extensionless URLs give 404 unless some URL Rewrite module is used or wildcard mapping is enabled &lt;/li&gt;&lt;li&gt;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. &lt;/li&gt;&lt;li&gt;Mapping wildcard extension to ASP.NET introduces the following problems: &lt;/li&gt;&lt;ul&gt;
&lt;li&gt;Slow performance as all static files get handled by ASP.NET and ASP.NET reads the file from file system on every call&lt;/li&gt;&lt;li&gt;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.&lt;/li&gt;&lt;li&gt;Cache-Control header does not produce max-age properly and thus caching does not work as expected. Learn about caching best practices from here. &lt;/li&gt;&lt;li&gt;After deploying on a domain as the root site, the homepage produces HTTP 404.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;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:&lt;br /&gt; &lt;br /&gt;&lt;ul&gt;
&lt;ul&gt;
&lt;li&gt;Install an HttpModule that installs a Compression Stream on Response.Filter so that anything written on Response gets compressed. This serves dynamic requests.&lt;/li&gt;&lt;li&gt;Replace ASP.NET's DefaultHttpHandler that listens on &lt;b&gt;.&lt;/b&gt; for static files.&lt;/li&gt;&lt;li&gt;Write our own Http Handler that will deliver compressed response for static resources like Javascript, CSS, and HTML. &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;b&gt;Read on&lt;/b&gt;&lt;br /&gt;Read details about this on my blog:&lt;br /&gt; &lt;br /&gt;&lt;a href="http://code.msdn.microsoft.com/fastmvc/Wiki/View.aspx?title=http%3a%2f%2fmsmvps.com%2fblogs%2fomar&amp;amp;referringTitle=Home"&gt;http://msmvps.com/blogs/omar&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>oazabir</author><pubDate>Mon, 30 Jun 2008 10:53:30 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080630A</guid></item></channel></rss>