c# - .NET 缓存框架

标签 c# asp.net asp.net-mvc caching

在我正在处理的 ASP.NET MVC 应用程序中,有大量静态数据(在运行时没有更新/插入此表),我需要通过按不同列分组或求和来检索这些数据向上和聚合,数学运算非常简单。

现在向存储库发出了很多调用,这会减慢 Controller 的响应速度。你能推荐一个好的缓存框架吗?它允许我在不编写自定义代码的情况下缓存存储库调用(使用相同的输入参数)

最佳答案

Memorycache只需添加到您的存储库中即可满足您的情况

但请记住:

The MemoryCache class is similar to the ASP.NET Cache class. The MemoryCache class has many properties and methods for accessing the cache that will be familiar to you if you have used the ASP.NET Cache class. The main differences between the Cache and MemoryCache classes are that the MemoryCache class has been changed to make it usable by .NET Framework applications that are not ASP.NET applications. For example, the MemoryCache class has no dependencies on the System.Web assembly. Another difference is that you can create multiple instances of the MemoryCache class for use in the same application and in the same AppDomain instance.

关于c# - .NET 缓存框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17359924/

相关文章:

ASP.NET Web API、Web 服务发现和客户端创建

c# - 如何将输入从 Blazor 组件传递到 Core MVC Controller ?

c# - LINQ 和 EF6 : The context cannot be used while the model is being created

c# - 如何将winform的自动滚动定位在顶部?

c# - 困惑为什么这个 C# 代码编译,而类似的代码不

c# - 访问由 CreateChildControls() 创建的控件

c# - 与重复的组合 C#

ASP.NET web.config 授权设置在子文件夹中被忽略

javascript - 动态插入分页符

asp.net - 在 GridView 中将可排序的行标题居中