ASP. NET Web State Management

Source: Internet
Author: User

Recently, I have collected some content of ASP. NET WEB state management, and finally summed up the content.

1. Hope that you can master some and invest for yourself through the arrangement.

2. In order to forget, but also waste time to gather.

3. Hope to help the park friends, this is a very happy thing

4. I hope the heroes see problems in time to help correct, do not want to mislead themselves, but also do not want to mislead the park friends, under the grateful

No more sharpening, serving immediately.

Name

User

Survival time

Data

Position

Advantage

Disadvantage

Suggestions

Application

All Users

Application restart

No limit, only stored once

Server that can be stored in the database

1. Simple to implement

2. Entire application scope (public)

1. The scope of the entire application scope leads to no private space

2. Server hangs, upgrades, and shutdowns may result in data loss or corruption

3. Server memory needs to be occupied

Store global information that multi-user uses but does not change frequently and does not consider security

Cookies

Current user

Generally very short, but as long as the user does not delete, can be months or even a few years

Small and often changing data

Client

1. Storage Time Configurable

2. No server resources required

3. Simple

4. Persistence of data

1. Limited data size

2. User can disable

3. Potential security Risks

A small amount of data that needs to be on the client side without having to consider security

QueryString

One or a group of users

For next request (can be reused across multiple requests)

Very small, simple data

Client

1. No server resources required

2. Be widely supported

3. Simple to implement

1. Potential security risks

2. Limited capacity (limited by URL length)

A small amount of data that is sent from one polygon to another or to the same page, without regard to security, via links

Session

Current user

Support Self-invalidation as long as the user is online and within the timeout period (typically 20 minutes)

No limit, but should be as small as possible, because each user has their own session of the storage

Server

1. Simple to implement

2. You can use Session management events

3. Persistence of data

4. Can be used between multiple computers and processes

5. Compensate for Cookie Limitations

6. Can customize and extend the session

1. Performance issues

Need to consider security, storing short-term information for a specific individual session

Cache

All users or subsets of users

Can be long and short according to actual needs

Can be very large, can be very small, it can be very complex

Client/server

1. With ASP. NET Management

2. When memory is low or timed out, it will automatically clear

3. Configurable

4. Reduce the burden of Web service or database

5. Improve performance

6. Reliability

1. Synchronization is not timely

2. Extensibility Issues

3. Maintenance costs

Data that users frequently access but do not update frequently

View State

Current user

A page

A small amount of information, with the postback of the page, the data will be sent back and forth on the page

Client, stored as a hidden domain

1. No server resources required

2. Simple to implement

3. Enhance the whole sex

1. Performance issues

2. Device Limitations

3. Potential security Risks

Store a small amount of page information that needs to be sent back

control state

current user

one page

Small amount of information, to and from the control used by the server state information

client, The default is to store

1. No server resources

2. Reliable

3. General

Hidden fields

Current user

A page

Small and often changed data

Client

1. No server resources required

2. Be widely supported

3. Simple to implement

1. Potential security risks

2. Easy to store data

3. Performance issues

4. Storage Limits

A small amount of page information that needs to be sent to another page or postback without regard to security

Profile Properties

Current user

Configuration file Updates

Any type of data

Server

1. Persistence of data

2. Can be used between multiple computers and processes

3. Extensibility

1. Performance issues

2. Additional Configuration requirements

3. Maintain data

Information that needs to be persisted after the user session expires, information that needs to be restored when the user next accesses

Database

Current user

As long as it doesn't get deleted

Any type of data

Server

1. Security

2. Large amount of data storage

3. Persistence of data

4. Stability and data integrity

5. Accessibility

6. Be widely supported

1. Complexity

2. Performance issues

The information that is needed to store a large amount of information, use administrative transactions, or the entire application life cycle requires the use of information that is accessed again. Consider data mining and consider security.

Hope again, if there is a problem can be timely help correct, there are questions please leave a message, help on the support!

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.