Site sponsored by: Idera The gold standard of SQL Server performance monitoring & diagnostics.
SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Quiz
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Performance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
Developer
General DBA
ASP.NET / ADO.NET

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

Recover Data Using Database Snapshots
Analyze and Fix Index Fragmentation in SQL Server 2008
Powerful Geographical Visualisations made easy with SQL 2008 Spatial (Part 2) ...
Backup User Databases Using a Maintenance Plan

More     
 
Latest FAQ's

How to alter a User Defined Data Type?
How to unzip a File in SSIS?
How to view previous query plans?
ALTER TABLE SWITCH statement failed because the object '%.*ls' is not ...

More     
   
Latest Software Reviews

Spotlight on ApexSQL Doc 2008
ApexSQL Enforce
Embarcadero Change Manager
SQL Server DBA Dashboard

More     

articles >> asp.net / ado.net >> Caching in ASP.NET (Part II) ...

Caching in ASP.NET (Part II)

By : Joydip Kanjilal
Feb 28, 2007

Page 3 / 3

File Based Expiration

This is implemented by using a file as a cache dependency. Whenever the contents of the dependent file are changed, the cached is invalidated. As shown in the code snippet below.

Cache.Insert("Country", obj, new CacheDependancy(Server.MapPath("CountryList.xml")));
Cache.Insert("Country", xmldocumentObject,cacheDependencyObj);

Key Based Expiration

The third type of dependency is the key dependency.  This implies that you can map a cache entry to an existing dependency.  Now, when the depended-upon entry changes or expires, the dependent entry will also be expired.  You can have an array of keys that can be specified as a single CacheDependency. Refer to the code snippet below:

string[] keys = new string[] {"key"};
CacheDependency cacheDependencyObj = new CacheDependency(null,keys);
Cache.Insert("Country", xmldocumentObject,cacheDependencyObj);

Enterprise

Library Caching Application Block

The Patterns and Practices Group of Microsoft’ came up with the reusable, configurable and extensible Enterprise Library Caching Block that enables you to incorporate local cache capabilities in your applications. Microsoft recommends usage of this block when the volume of relatively static data transport is high in your application and performance is a major concern.

The Enterprise Library Caching Application Block facilitates storage of cached data in the memory, isolated storage (i.e., an XML file) or in a database. The Enterprise Library Caching Application Block encapsulates efficient, consistent caching strategies and, hence, simplifies implementation of caching strategies in enterprise application development.

The salient features of the Caching Application Block include:

    Support for efficient caching strategies in web applications
    Configurable
    Thread Safety

Conclusion

Caching is a great tool that can be used to boost the performance of your web applications. Caching in ASP.NET is an effective and powerful way of boosting application performance while minimizing the usage of precious server resources. However, choosing the appropriate type of caching and caching the right type of data goes a long way in designing and developing high performing applications. The fourth and final article in this series will discuss the best practices for Caching in ASP.NET and demonstrates a sample application that will present all the concepts that we have learnt so far in this series.

<< Prev Page         








Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | QDPMA Performance Tuning | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 1999-2008 by T10 Media. All rights reserved