OutputCache learning-concept, outputcache Concept

Source: Internet
Author: User
Tags microsoft sql server 2005

OutputCache learning-concept, outputcache Concept

For more information about caching, see here.

 

Cache category: 
  • Client Caching)
  • Proxy Caching)
  • Reverse Proxy Caching)
  • Web Server Caching)
Benefits and Applications of Caching:
  • This allows resource files such as css, js, image, and aspx to read the local file during the second access instead of requesting the server again, reducing the client's pressure on server resource requests, accelerate the client response speed.
  • Frequently used data sources are stored in the data cache or memory to reduce database requests and relieve database pressure.
  • Deploying websites on multiple computers and processing them in a distributed manner can effectively solve the pressure on one server caused by multiple user requests and speed up client request response (distributed deployment ).
  • A page that is frequently accessed but frequently not updated with data can be statically processed to effectively reduce server pressure and client response speed.

 

Of course, the above is my personal opinion. If you have any questions, please correct them.

 

ASP. NET provides a convenient way to control the cache. @ OutputCache command can be used to control the page output Cache OutputCacheSyntax:

<% @ OutputCache Duration = "# ofseconds"
Location = "Any | Client | Downstream | Server | None |
ServerAndClient"
Shared = "True | False"
VaryByControl = "controlname"
VaryByCustom = "browser | customstring"
VaryByHeader = "headers"
VaryByParam = "parametername"
VaryByContentEncoding = "encodings"
CacheProfile = "cache profile name | ''"
NoStore = "true | false"
SqlDependency = "database/table name pair | CommandNotification"
ProviderName = "Provider Name"
%>

OutputCache attributes:

Refer:Http://msdn.microsoft.com/zh-cn/library/hdxfb6cy.aspx

  • Duration: Page or user control cache time (in seconds ). Set this feature on the page or user control to create an expiration Policy for the HTTP response from the object and automatically cache the page or user control output.
  • Location: One of the OutputCacheLocation enumerated values. The default value is Any.

Any: the output cache can be located on the browser client that generates the request, the proxy server that participates in the request (or Any other server), or the server that processes the request. This value corresponds to the HttpCacheability. Public enumeration value.
Client: the output cache is located on the browser Client that generates the request. This value corresponds to the HttpCacheability. Private enumeration value.
Downstream: the output cache can be stored on any HTTP 1.1 cacheable device, except for the source server. This includes the proxy server and the client sending the request.
None: the output cache is disabled for the requested page. This value corresponds to the HttpCacheability. NoCache enumeration value.
Server: the output cache is located on the Web Server that processes the request. This value corresponds to the HttpCacheability. Server Enumeration value.
ServerAndClient: the output cache can only be stored on the source server or the client sending the request. The proxy server cannot cache the response. This value corresponds to a combination of HttpCacheability. Private and HttpCacheability. Server Enumeration values.

  • CacheProfile: The name of the cache settings associated with this page. This is an optional feature. The default value is a null string ("").
  • NoStore: A boolean value that determines whether to block second-level storage of sensitive information.
  • ProviderName: A string value that identifies the custom output cache provider to be used.
  • Shared: A boolean value to determine whether the output of the user control can be shared by multiple pages. The default value is false.
  • SqlDependency: String value that identifies a group of database/table name pairs. The output cache of pages or controls depends on these name pairs. Note that the SqlCacheDependency class monitors the tables in the database on which the output cache depends. Therefore, when table items are updated, these items will be removed from the cache when table-based round robin is used. If CommandNotification is used (in Microsoft SQL Server 2005), The SqlDependency class is used to register the query notification with the SQL Server 2005 Server.
  • VaryByCustom: Any text that indicates custom output cache requirements. If the feature value is browser, the cache varies with the browser name and major version information. If you enter a custom string, you must overwrite the GetVaryByCustomString method in the Global. asax file of the application.
  • VaryByHeader: A semicolon-separated HTTP header list, used to change the output cache. When this feature is set to multiple headers, the output cache contains a different version of the Request Document for each specified header combination.
  • VaryByParam: A semicolon-separated string list used to change the output cache. By default, these strings correspond to query string values sent using the GET method feature, or parameters sent using the POST method. When you set this feature to multiple parameters, the output cache contains a different version of the request documentation for each specified parameter combination. Possible values include none, asterisks (*), and any valid query string or POST parameter names.
  • VaryByControl: A semicolon-separated string list, used to change the output cache of the user control. These strings represent the ID attribute values of the ASP. NET Server Control declared in the user control.
  • VaryByContentEncodings: String list separated by semicolons, used to change the output cache. Apply the VaryByContentEncodings feature to the Accept-Encoding header to determine how different content codes can obtain cache responses. For more information about how to specify the Accept-Encoding header, see section 1.1 of the Hypertext Transfer Protocol -- HTTP/1.1 (Hypertext Transfer Protocol -- HTTP/14.3) specification on the W3C website.

 

This article describes the concept of OutputCache, and describes the use and differentiation of each attribute.


C # places the cached file in outputcache

It should be the cache of the client. Put it in the temporary folder of the client.
 
Concepts of learning

● Proactive attitude

There is a big difference between "Active Learning" and "passive learning". Active Learning does not mean that it takes a long time to learn and learn consciously without the supervision of parents and teachers, it refers to actively identifying, actively solving, or trying to solve problems when learning knowledge. Learning an active learning method makes learning easier and takes less time. A better score.

● "Criticism" attitude

"He shan has a rock, liangbi more than crystal clear", holding a criticism attitude is actually a rigorous attitude, only criticism can correct and make progress.

Criticism goes through three stages: Feeling, understanding, and demonstration. Therefore, the adoption of the learning attitude of criticism often gives us a deeper understanding and understanding of the problem. The true critics should seek the unity of rationality and sensibility, instead of having no aim, it is not the blind intoxication of knowing but not knowing why.

● Attitude towards both sides

We can learn useful things at any time in our lives. Everyone and everything around us may help and inspire us. Everything has its own attributes, there is a dual nature of mutual opposition, and it will transform to the opposite direction and opposition under certain conditions. This requires us to foster strengths and circumvent weaknesses and turn the weaknesses into growth, "Choose its good, and its bad." We can learn from good people and good events, and learn from bad people and bad events. Learning both sides of the learning attitude is "getting twice the result with half the effort" for us?

● Modest attitude

"We must have a teacher ." Modesty is vital to everyone, especially learning.

"The more you are, the more you boast, the more you will doubt ." The more people who really want to learn the skills, the more questions they don't understand, the more content they need to learn, and the more they know that everyone has what they know, you need to learn from others with an open mind and ask for advice from others. You must be good at discovering what you know, what you know, and what you are good at learning from others that is conducive to your own development.
Reference: www.ehappystudy.com/..-0.htm

Related Article

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.