有关.net中的缓存和应用程序状态的信息 [英] Information on Caching and application state in .net

查看:50
本文介绍了有关.net中的缓存和应用程序状态的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序状态和缓存之间的差异是什么?

What is the diffference between application state and caching?

推荐答案

缓存与会话状态管理不同。

通常使用缓存提高性能。

状态管理用于在网页中的不同页面或状态之间共享数据。
Caching is different from Session state management.
Caching is generally used to improve performance.
State management is used to share data across different pages or states in a web page.


有一篇很好的文章供您使用。 应用程序状态与应用程序缓存 [ ^ ]。



也按照答案应用程序与会话与缓存 [ ^ ]。



There is a nice article for you. Application state vs. Application Cache[^].

Also follow the answer Application vs Session vs Cache[^].

引用:

应用程序和会话状态有一个非常重要的区别:



应用程序状态是ASP.NET应用程序中所有类都可用的数据存储库。应用程序状态存储在服务器的内存中,比在数据库中存储和检索信息更快。与会话状态(特定于单个用户会话)不同,应用程序状态适用于所有用户和会话。因此,应用程序状态是存储少量常用数据的有用位置,这些数据不会从一个用户更改为另一个用户



应用程序状态概述 [ ^ ]

会话状态概述 [ ^ ]



另一方面,缓存允许您将对象存储在需要大量服务器资源来创建的内存中 - 它提供了强大的功能,允许您自定义项目的缓存方式以及缓存时间 - 您可以设置广泛的属性,如优先级和到期时间。



缓存应用程序数据概述 [ ^ ]



虽然它们可能看起来很相似,但它们明显是分开的,并且在最广泛的意义上在ASP.NET应用程序中扮演不同的角色。

Application and Session State have a very important difference:

Application state is a data repository available to all classes in an ASP.NET application. Application state is stored in memory on the server and is faster than storing and retrieving information in a database. Unlike session state, which is specific to a single user session, application state applies to all users and sessions. Therefore, application state is a useful place to store small amounts of often-used data that does not change from one user to another

Application State Overview[^]
Session State Overview[^]

Caching, on the other hand, allows you to store objects in memory that require extensive server resources to create - it offers powerful features that allow you to customize how items are cached and how long they are cached - you can set extensive properties like priority and expiration.

Caching Application Data Overview[^]

Although they might appear similar, they are distinctly separate and have different roles to play in an ASP.NET application in its broadest sense.


这篇关于有关.net中的缓存和应用程序状态的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆