Changing The OutputCache Provider During Runtime

Sunday, August 1, 2010

Changing The OutputCache Provider During Runtime I got a question in the post I wrote about ASP.NET Output Cache Provider which asks whether we can change the cache provider during runtime. The post will try to answer the question. Overriding The OutputCache Provider One of the changes in ASP.NET 4 is the ability to override the OutputCache provider name in the Global.asax file. This enables us to create logic that stores the OutputCache in more then one type of cache...
no comments

ASP.NET Output Cache Provider

Sunday, July 18, 2010

ASP.NET Output Cache Provider One of the new features that were shipped with ASP.NET 4 was new providers for caching purpose. In this post I’ll explain one of them – the OutputCacheProvider. OutputCacheProvider Up until ASP.NET 4 the output cache mechanism was implemented as in-memory caching and we couldn’t do nothing to change its behavior. If we desired to use a...
3 comments

Cache Retrieval Pattern

Sunday, June 13, 2010

Cache Retrieval Pattern In my previous post I wrote about cache layer and its position in every application. In this post I’m going to explain what is the cache retrieval pattern and show an example of how to implement it. Cache Retrieval Pattern When we implement a cache layer we need a strategy in order to retrieve cached items. The cache retrieval pattern is very simple and can be imposed into any application very fast. So how does it work? The business logic component will use the cache API in order to check whether some data exists in the cache. If the...

Cache Layer

Friday, June 11, 2010

Cache Layer Lately I found myself in some architecture consulting sessions at some customers. In every one of those customers I found myself explaining how to implement a cache layer in order to decrease the amount of round trips to the database and for better scalability. In this post I’ll try to explain in high level how to build a cache layer. Deciding to Build a Cache Layer Every application that performance is important to its developers and managers must contain some sort of caching. The cache is a veryfast in memory resources container which holds relevant data close to the application...

Velocity Cache Notifications

Friday, November 13, 2009

Velocity Cache Notifications I’ve been asked by a friend how to use cache notifications in Velocity. if you don’t know, Velocity, Microsoft distributed cache, offers a cache notification mechanism that can help you to get notified when cache operations occur. This post will help you to get started with Velocity cache notifications. Cache Notifications As written earlier, Velocity has a cache notifications feature. That feature enables us to get notified when cache operations occur in our cache cluster. What happens when this feature is enabled is that we get asynchronous cache notifications for many aspects of the cluster including the cache,...

Replacing ASP.NET Session with Velocity Session Provider

Tuesday, October 6, 2009

Replacing ASP.NET Session with Velocity Session Provider One nice feature of Microsoft Distributed Cache aka Velocity is a custom session provider that can replace the ASP.NET default session provider. In this post I’ll explain how to replace ASP.NET session with the Velocity session provider that is being provided with Velocity. Why Replacing the ASP.NET Session with Velocity Session? Sometimes we want to share a session across servers in a server farm. The ways to do so are to use a State Server or a database. When Velocity came out it was released (currently in CTP) with a custom session provider. The use...

Data Types For Caching

Data Types For Caching One of the big problems I see when I talk with people about caching is not recognizing the  different cached data types. Understanding the different types of data can help us to define what sort of caching do we need and also how to use caching systems to achieve the appropriate cache scenario we are going to use. This post will describe how to define data types for...
no comments

Building a Simple Cache Manager

Friday, August 21, 2009

Building a Simple Cache Manager As I wrote in a previous post, I’ve started to work in a new project. My role there is a technical team leader of a very big team (10 developers). Part of my role is helping the team to create infrastructure for their applications. As part of the application’s infrastructure, I recommended to start using caching for better performance. ...
no comments

How to Create a Simple Enterprise Library Cache Manager Provider for Velocity

Monday, July 27, 2009

How to Create a Simple Enterprise Library Cache Manager Provider for Velocity In the previous post I promised to give the recipe of how to create the a simple Velocity cache manager provider using the Application Block Software Factory. In this post I’ll keep my promise. Creating the Project The first thing to do is to create the project. If you don’t have Application Block Software Factory installed on your computer then you can read an old post that I wrote in order to install it. In VS2008, choose the Guidance Packages –> Application Block Software Factory project type and...

Creating a Simple Enterprise Library Cache Provider for Velocity

Sunday, July 26, 2009

Creating a Simple Enterprise Library Cache Provider for Velocity I decided to write a simple cache manager provider for Velocity (Microsoft Distributed Cache) using the Enterprise Library Application Block Software Factory. You can download the solution from here. If you put the two dll’s I provided (Microsoft.Practices.EnterpriseLibrary.Caching.Velocity.dll and Microsoft.Practices.EnterpriseLibrary.Caching.Velocity.Configuration.Design.dll) in the directory of EntLibConfig...