简体   繁体   English

从ASP.Net中的页面后面缓存数据

[英]Caching the data from behind pages in ASP.Net

I've simplified this example a lot, but the theory is there. 我已经大大简化了这个示例,但是理论已经存在。

I have a table which contains content for a page - there might be 3 or 4 rows per page. 我有一个包含页面内容的表-每页可能有3或4行。

Every time a page loads, the database is queried and the content loads. 每次加载页面时,都会查询数据库并加载内容。 This is fine generally, but on busy sites this can hit the database quite a lot. 通常,这很好,但是在繁忙的站点上,这可能会严重影响数据库。

I'm looking for some kind of "caching" solution - that ideally doesn't use much in the way of memory (ideally it'll be file system based). 我正在寻找某种“缓存”解决方案-理想情况下,它不会在内存上使用太多(理想情况下,它将基于文件系统)。

Any ideas? 有任何想法吗?

Anything wrong with ASP.NET's built in Cache ? ASP.NET的内置缓存有什么问题吗?

Also might want to check out How to implement a custom cache provider with ASP.NET MVC 也可能想看看如何使用ASP.NET MVC实现自定义缓存提供程序

As a final suggestion, you may want to look into building a filesystem-based cache using the System.Caching classes documented here . 作为最后的建议,您可能需要研究使用此处记录的System.Caching类构建基于文件系统的缓存。 From a brief perusal, it looks like you'd probably want to inherit from ObjectCache. 从简短的阅读来看,您似乎想要从ObjectCache继承。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM