Wednesday, 5 October 2011

ASP.NET Caching Overview


An application can often increase performance by storing data in memory that is accessed frequently and that requires significant processing time to create. For example, if your application processes large amounts of data using complex logic and then returns the data as a report accessed frequently by users, it is efficient to avoid re-creating the report every time that a user requests it. Similarly, if your application includes a page that processes complex data but that is updated only infrequently, it is inefficient for the server to re-create that page on every request.

To help you increase application performance in these situations, ASP.NET provides caching using two basic caching mechanisms. The first is application caching, which allows you to cache data you generate, such as a DataSet object or a custom report business object. The second is page output caching, which saves the output of page processing and reuses the output instead of re-processing the page when a user requests the page again.


Application Cache

The application cache provides a programmatic way for you to store arbitrary data in memory using key/value pairs. Using the application cache is like using application state. However, unlike application state, the data in the application cache is volatile. This means it is not stored in memory for the life of the application. The advantage of using the application cache is that ASP.NET manages the cache and removes items when they expire or become invalidated, or when memory runs low. You can also configure application caching to notify your application when an item is removed. For more information, see Caching Application Data.




Page Output Cache



A typical kind of caching for server applications is output caching. Output caching enables you to store rendered HTML. The stored HTML is served in response to subsequent requests for the same page. You can use output caching to cache a whole Web page or just the output of an ASP.NET control. Output caching enables you to do the following:
  • Configure ASP.NET to cache a particular output cache entry for a specific period.
  • Cache a different version of the content based on the browser type or user-language preferences of the clients visiting your application.
  • Cache a mobile version of a page that differs from a version that is optimized for a desktop browser.
  • Configure ASP.NET to evict a cache entries based on an external event.
Output caching is extensible. You can use a custom output cache provider that can store data on any data storage device.

The page output cache stores the contents of a processed ASP.NET page in memory. This lets ASP.NET send a page response to a client without going through the page processing life cycle again. Page output caching is especially useful for pages that do not change often but that require significant processing to create. For example, if you are creating a high-traffic Web page to display data that is not frequently updated, page output caching can dramatically increase the performance of that page. Page caching can be configured individually for each page, or you can create cache profiles in the Web.config file, which allow you to define caching settings once and then use those settings with multiple pages.

Page output caching provides two models for page caching: full-page caching and partial-page caching. Full-page caching persists the complete contents of a page and uses the cached page content to fulfill client requests. Partial-page caching persists specified portions of a page and lets other portions of the page be created dynamically.



5 Comments:

At 29 December 2015 at 02:11 , Blogger wdmtest said...

Creating Asynchronous, Transactional, Cache-Friendly Web Services
Scalability Challenges with Web Services
Asynchronous Web Methods
Modifying the ASP.NET AJAX Framework to Handle Web Service Calls
Developing Your Own Web Service Handler
Making an Asynchronous and Cache-Friendly Proxy
Scaling and Securing the Content Proxy

 
At 20 May 2016 at 03:05 , Blogger Unknown said...



It is really very excellent,i find all articles was amazing.awesome way to get exert tips from everyone,
not only i like that post all peoples like that post,because of all given information was wonderful and it's very helpful for me.
Dotnet training in Chennai

 
At 6 June 2019 at 09:45 , Blogger Sergey said...

When you have the most advanced woocommerce themes at your fingertips, you feel comfortable enough to build any kind of shop using WordPress

 
At 19 June 2024 at 08:57 , Blogger The Vantage Vibe said...

Discover the latest trends in education, science, nature, and more. Stay informed and entertained with The Vantage Vibe's daily dose of interesting content.

 
At 8 August 2024 at 06:03 , Blogger Hasnath said...

Here we create Balloon decoration which turns moments into memories. To make your day very special with lots of love and with budget friendly, you are at the right place. If you are looking for party decor connect us on https://partyblast.in/

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home