.NET Data Caching
An introduction to using data caching in your ASP.NET pages, from simple time-specific data expiration to file dependencies, plus a real-world example with caching for data in a pagable DataGrid control.
ASP.NET Caching
Caching is an important concept in computing. When applied to ASP.NET, it can greatly enhance the performance of your Web applications. In this article, I will discuss some of the techniques for caching ASP.NET pages on the server side.
Caching Architecture Guide for .NET Framework Applications
This document provides caching guidance for developers and architects using the Microsoft® .NET Framework. It introduces the concepts involved in caching, discusses the technologies that can be used to provide caching facilities, and describes the mechanisms you should use implement to cache data in a distributed application. It contains recommendations and best practices for all aspects of caching in .NET-based applications.
Caching ASP.NET Pages
Covers output caching in ASP.NET, a simple yet powerful way to increase a Web server's throughput by allowing the entire response content from dynamically generated pages to be cached.
Caching in ASP.NET
The performance, mainly in terms of speed, of a web page drives the user satisfaction. Building up traffic on a web site is the key and for that we cannot afford to have slow web pages.
Creating a Cache Configuration Object for ASP.NET
Learn how the CacheConfig helper class can improve caching policies across an ASP.NET application, improve reuse of cached data, and significantly reduce lines-of-code to implement caching using best practices. This article builds upon the ASP.NET Caching: Techniques and Best Practices article.
Data Caching Techniques in ASP.NET 1.x and 2.0
This article looks at the different ways that you can boost performance of your applications by caching the data they use. While not aimed at beginners, rather at developers who have a reasonable grasp of ASP.NET already, it does discuss the available techniques both at high level, and in detail through examples. The article demonstrates the ways that the various options can be used, and points to sources of more information. You dont need to be an ASP.NET expert to benefit from the content or the techniques described, yet this article will also appeal to more experienced developers who have not yet experimented with new features in ASP.NET 2.0 such as SQL data cache invalidation.
Effective Cache Expirations
This article will focus on how to capture cache expirations and repopulate the cache. The key to using this technique is to immediately replace the item that just expired with its original value, then spend time acquiring the updated data, and if successful replace the outdated data.
HOW TO: Control Page Output Caching in ASP.NET
This article demonstrates how to use the @ OutputCache directive to control page output caching in ASP.NET with Visual C# .NET. You can use this technique to cache your site's most frequently accessed pages, which can substantially increase your Web server's throughput. The throughput is commonly measured in requests per second. Although the sample code in this article demonstrates how to use the Duration and VaryByParam attributes, the article also includes a brief description of other approaches that you can use with the @ OutputCache directive.
HOW TO: Perform Fragment Caching in ASP.NET
This article demonstrates how to implement fragment caching in ASP.NET. Fragment caching does not actually cache a Web Form's code fragments directly; fragment caching refers to the caching of individual user controls (.ascx) within a Web Form. Each user control can have independent cache durations and implementations of how the caching behavior is to be applied. The sample code in this article illustrates how to achieve this functionality.
Implement Key-Based Dependencies for Data Caching in ASP.NET
This article demonstrates how to implement data caching by using key-based dependencies in a Microsoft ASP.NET application. The example that is presented in this article creates and inserts a DataSet object into the cache with a dependency set on another cache entry item by referencing its key. For examples of data caching with time or file-based dependencies, refer to the "References" section in this article.
In-depth Look at Caching: Part 1
In ASP.NET caching has been made super easy - you do can do page caching, fragment caching and data caching with only a few lines of code. So what is the benefit of caching? First, it can cut down execution times drastically, especially on pages that load huge amounts of data, by removing the need to reload the data on every page request. When you cache a piece of data, it remains in memory.
Invalidating an ASP.NET Web Application Cache Item from SQL Server #1
We have seen over and over again the question, "How can I invalidate a cache item in my ASP.NET Web application when a change is made in my database?" Well, this article will demonstrate one way to accomplish this using triggers, a console application, and dependency files. As the title implies this is a two part article, the second part (or example) will be much more complicated and will span many different types of technologies including HttpHandlers, SQL Server, and enabling SQL Server itself to make HTTP requests using extended stored procedures. The only reason I wrote this example was because as I was working through the very complicated version I thought of this one and decided, what the heck I'll write about it.
On the Hour Caching
The Cache object in ASP.Net provides a mechanism to share information across pages and users. It is similar to the Application object from ASP, but supports dependencies and expirations. A particularly useful application of this is to set an absolute expiration time at which a cache item should be "expired" or removed from the cache. Utilizing this technique a web site can increase its performance and reduce middle tier calls or database queries.
Precise .NET Server Content Caching
Caching in .NET allows you to maintain high-performance pages and scalable applications. Simple Page output caching for just three seconds can dramatically boost page speed. NET is already up to 3x faster than legacy ASP. Now .NET gives you the option for caching server controls or (Fragment caching) and finally offers the powerful Cache API which gives you the ability to programmatically cache any objects whether they are strings or entire datasets, and within a page output or a user control.
SqlDependency - Proof of Concept (Part II)
The ASP.NET Cache supports invalidation based on key,
timestamp, or file dependencies, e.g. file changes and the
cache item is invalidated. A frequent question is how to
support this from a database, e.g. we're caching a DataSet, or
some other reperesentation of data, in the ASP.NET Cache and
the table(s) representing that data changes; thus the data in
the Cache is no longer valid. This sample shows using some
simple code that will automatically wire up a trigger on a
table and call an extended stored procedure to call back into
the ASP.NET application to invalidate the Cache.
Synchronizing Cache Access in ASP.NET
Have you ever used ASP.NET Application data caching functionality? Have you run into situations when data in the cache was inconsistent or was just not what you expected? The chances are you are running into synchronization issues when using the cache. An ASP.NET cache object has an application-wide scope and allows you to share data with several instances of the same page or multiple pages across the application. To be beneficial, the cache needs to be accessible to all the pages and to be really useful, there should be some control on who is updating the cache. If too many threads update the contents of a particular key, data will be corrupted.
Ultimate Caching: Output and Fragment Options
An in-depth look at Output and Fragment caching using ASP.NET, including working examples for multiple scenarios. A follow-up article will discuss the cache API.
Computer Professionals: Are you owed Overtime? Federal and State Laws may allow computer professionals to collect overtime. Our law firm is experienced, and has initiated class action lawsuits against some of the largest computer companies to collect back pay and overtime. Strictly Confidential.
Oracle Magazine contains technology-strategy articles, sample code, tips, Oracle and partner news, an all-new Oracle Developer section for Java developers, and more.
subscribe now