在服务器端缓存动态页面 [英] Cache dynamic page on server side
问题描述
我为球队写在ASP.NET/Razor和IIS上承载一个动态的内部状态页。该页面查询多种服务和SQL数据库生成动态内容。
I have a dynamic internal status page for the team written in ASP.NET/Razor and hosted on IIS. The page queries multiple services and sql databases to generate the dynamic content.
我不知道会产生什么不同的方式来缓存上述设置页面内容使页面没有查询每当用户加载页面,它使用的各种服务,而是它获取内容每隔几分钟。 (所有用户都看到相同的内容/页)
I was wondering what would be the various ways to cache the page content on the above setup so the page doesn't have to query the various services it uses whenever a user loads the page and instead it fetches the content every few minutes. (all users see the same content/page)
编辑:该网站是用C#编写的
The website is written using C#
推荐答案
如果您正在使用至少.NET 4.0,要使用高速缓存。
If you're using at least .Net 4.0, you want to use caching.
既然你不列出您使用的语言,最好的我所知道的是在这里你指出:
Since you don't list the language you're using, the best I know of is to point you here:
https://msdn.microsoft .COM / EN-US /库/ vstudio / Ff477235(v = VS.100)的.aspx
如果您正在使用C#(或擅长翻译C#为其他.NET语言)这个例子是非常好的:
If you're using c# (or are good at translating c# into another .Net language) this example is really good:
<一个href=\"http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/improving-performance-with-output-caching-cs\" rel=\"nofollow\">http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/improving-performance-with-output-caching-cs
这篇关于在服务器端缓存动态页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!