Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们正在考虑使用 HttpRuntime.Cache 来存储所有用户经常访问的数据,但想知道使用 HttpRuntime.Cache 对性能有何影响?缓存的内容是否在每个 http 请求和响应中传输?那里可以合理存储多少信息?
使用 HttpRuntime.Cache 对性能有何影响?
通常,缓存存储在服务器的内存中,除非服务器配置为 Web Farm 或 Web Garden。结果,访问缓存真的比数据库快。
缓存的内容是否在每个 http 请求和响应中传输?
不。
那里可以合理存储多少信息?
实际上,没有限制。但是,您只想缓存信息 - 您经常需要并且不经常更改。此外,您不想缓存图像和文件 - 缓存不是为此而设计的。