ASP.NET MVC on Cassini: How can I force the "content" directory to return 304s instead of 200s?
Posted
by Portman
on Stack Overflow
See other posts from Stack Overflow
or by Portman
Published on 2009-04-27T21:57:26Z
Indexed on
2010/06/10
12:23 UTC
Read the original article
Hit count: 374
Scenario: I have an ASP.NET MVC application developed in Visual Studio 2008. There is a root folder named "Content" that stores images and stylesheets. When I run locally (using Cassini) and browse my application, every resource from the "Content" directory is always downloaded. Using Firebug, I can verify that the web server returns an HTTP 200 ("ok").
Desired: I would like for Cassini to return HTTP 304 ("not modified") instead of 200. This is the behavior when running the site under IIS7.
Reasoning: The site I am working on has a large number of static resources (often as many as 40 per page). Browsing the site is very fast on IIS7, because these resources are (correctly) cached by the browser. However, browsing the site on my local machine is painfully slow.
Pages that render in under 1 second on IIS7 take over 30 seconds to render on Cassini. It's actually faster for me to upload the entire website every few minutes and test from there. (Yes, I recognize that this is perverse and crazy.)
So: how can I instruct/trick Cassini into treating the "Content" directory like IIS7 does?
© Stack Overflow or respective owner