Cache Management in ASP.NET
Introduction
Before explaining cache management in ASP.NET, let me clarify that different people use different terms for explaining the same concept i.e. managing data. Some people refer to it as state management and some others refer to it as cache management. I love to use the term cache management, may be because I like the word "cache". But conceptually there is no difference between these two. Now let's discuss different aspects of cache management (or state management) in ASP.NET.
Although cache management is not an issue in Windows applications, it has always been a challenge in the web environment. Since HTTP is a stateless protocol and a web server doesn't recognize users between different requests, it becomes very important for us to recognize a particular user between different requests and also store data so that it can be re-used between different requests. ASP.NET provides many features for storing data both in the client (browser) and the server (web server) sides, but sometimes we get confused with when to use what. In ASP.NET we come across features like Session, Application and Cache objects, but it is important for us to understand the difference between them in order to effectively use them in web applications.
Background
In this article, I will touch upon the different cache management options available in ASP.NET. In a web application, sometimes we require to store data in the server side to avoid costly data retrieval operation from data stores and time consuming data formatting logic to improve application performance as well as to re-use the same data in subsequent requests across users, applications and machines. So, to achieve this we need to store (cache) data in the server side.
Caching helps us to achieve three important aspects of QoS (Quality Of Service):
Performance - Caching improves application performance by minimizing data retrieval and formatting operations.
Scalability - Since caching minimizes data retrieval and forma
相关文档:
ASP.NET AJAX(最初代码名为“ATLAS”)框架,作为重点支持ASP.NET开发平台的开源Ajax框架在它一出世时就受到广大.NET开发人员的青睐。在本文中,我们将专注于分析ASP.NET AJAX编程中服务器与客户端通信过程中的数据存储形式的问题。具体地说,我们将探讨一个实现序列化与反序列化的服务器端对象—JavaScriptS ......
using System;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
namespace op_db
{
/**//// <summary>
/// 专门用来处理与数据库的操作
/// </summary>
public class&n ......
public class DBHelper
{
private static SqlConnection connection;
public static SqlConnection Connection
{
&nb ......