gpt4 book ai didi

c# - .NET 缓存框架

转载 作者:太空狗 更新时间:2023-10-29 21:18:01 24 4
gpt4 key购买 nike

在我正在处理的 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com