SSI-like function in ASP.NET/ASP.NET MVC

This may be a heretical question. We have a large site where many pages are still in ASP. Basically, they are not very dynamic, but include (via SSI or Server.Execute) periodically regenerated pieces of HTML. It may look like caching to poor people, but it works very well, and I assume that Microsoft has heavily optimized IIS for this scenario.

Now we would like to achieve something similar in ASP.NET/ASP.NET MVC. We will periodically generate HTML snippets (usually hourly or so) that we would like to include in ASP.NET/ASP.NET MVC wrappers that provide the main site chrome, some navigation, and possibly some other dynamic content related to fragments. So this is a mixture, but the fact is that the generated HTML is periodically re-generated by an external process, mainly for performance reasons, and keeps our server farm in sync.

The closest I could find in ASP.NET was:

<% Response.WriteFile("GeneratedSnippet.inc"); %>

which seems to be equivalent

<% Server.Execute "GeneratedSnippet.inc" %>

in ASP. This is even faster because there is no code to execute. But it is not as effective as:

<!--#include file="GeneratedSnippet.inc" -->

, , IIS SSI, ASP . , Response.WriteFile, , . - ?

, , - ASP SSI, Response.WriteFile .

+3
1

?:)

SSI . , SERVER SIDE, , .

SSI, . HTTP, , Expires ETag.

ASP.NET ASP.NET MVC , .

+1

Source: https://habr.com/ru/post/1756773/


All Articles