Asp2.0 cache Overview

Source: Internet
Author: User
Tags server memory
Asp2.0 supports the following cache types:

1. Page output cache:

Is the simplest caching mechanism, which is to integrate the entire ASP. . NET page content is stored in the server memory. When a user requests this page, the system outputs relevant data from the memory until the cached data expires. In this process, the cached content is directly sent to the user without having to go through the page processing lifecycle. In general, the page output cache is particularly useful for pages that contain content that does not need to be modified frequently, but require a large amount of processing before compilation. (The page output cache stores all the page content in the memory and is used to complete client requests)

2. Partial page Cache

Save part of the page content in the memory to respond to user requests, while other parts of the page are dynamic content. There are two ways to implement page caching: Control caching and cache replacement. The former can also be used as a clip cache. This method allows you to include the information to be cached in a user control, and then mark the user control as cacheable. This method caches specific content on the page but does not cache the whole page. Therefore, you need to create the whole page every time. The cache replacement is the opposite to the control cache. This method caches the entire page, but the sections in the page are dynamic.

3. ApplicationProgramData Cache

It provides a programming method that stores any data in the memory through key/value pairs. The usage of application cache is similar to the application status, but the difference is that the data in the application data cache is easy to lose, that is, data is not stored in the memory throughout the application lifecycle. It has the advantage of ASP. Manage the cache. It will remove the items in the cache when the items expire, the items are invalid, or the memory is insufficient. You can also configure the application cache to notify the application when the items are removed.

4. cache dependency

2.0 the SQL data cache dependency function is added. Its core is the sqlcachedependency class. Different Versions of sqlserver have different degrees of support for SQL data caching. The usage varies greatly. 2.0 also supports custom cache dependencies with cachedependency class as the core, and aggregate cache dependencies with aggregatecachedependency class as the core.

Cache-related concepts

Clear cache:

This means to remove cached data from the memory. Reason (1. cache item data expiration 2. cache dependency changes 3. Insufficient Server Memory)

Cache Expiration:

Two data expiration types (1. you can set expiration time to specify how long a project expires after its last access. 2. absolute expiration specifies that an item expires at the specified time, regardless of the Access Frequency)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.