This may be a heretic question in a way. We have large site where lot of pages are still in ASP. Mostly, there are not really dynamic but they include (via SSI or Server.Execute) periodically regenerated chunks of HTML. It may look like a poor man's caching, but it has been working really well and I'm guessing that Microsoft has heavily optimized IIS for this scenario.
Now, we would like to be able achieve something similar in ASP.NET / ASP.NET MVC. We will have periodically generated HTML snippets (typically hourly or so) which we would like to include into ASP.NET / ASP.NET MVC wrappers providing the main site chrome, some navigation, and possibly some other dynamic content related to the snippets. So it's a mixture, but the point is that the generated HTML are periodically re-generated by an external process mainly for performance reasons and keeping our server farm in sync.
The closest thing in ASP.NET I was able to find was:
<% Response.WriteFile("GeneratedSnippet.inc"); %>
which seems to be equivalent to the
<% Server.Execute "GeneratedSnippet.inc" %>
in ASP. It's perhaps even faster because there is no code to execute. But it's not perhaps as efficient as:
<!--#include file="GeneratedSnippet.inc" -->
As I mentioned above, I suspect that IIS has been heaving optimized to handle SSI as well as ASP includes over the years. On the other hand, the Response.WriteFile most likely really reads the file and spits it out. Would anybody have an insight into two or some experience?
Maybe I worry too much, but most of our traffic heavy content still runs on ASP and uses lot of SSI's, and so even a little difference in Response.WriteFile may accumulate and have a visible impact.