Click here to Skip to main content
15,886,832 members
Articles / Web Development

MyCache: Distributed caching engine for an ASP.NET web farm - Part II: The internal details

Rate me:
Please Sign up or sign in to vote.
4.97/5 (20 votes)
27 Dec 2010CPOL17 min read 80.5K   1.2K   54  
Internal implementation of MyCache: A distributed caching engine for ASP.NET applications deployed under a load-balanced environment in web farms, which is built on top of WCF and the Microsoft Caching Application Block.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="DistributedCache._Default" %>
<%@ OutputCache Location="None" NoStore="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>MyCache demonstration Page</title>
    <style type="text/css">
        body
        {
            font-family: Verdana;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="background-color:Yellow;padding:5px;font-weight:bold">
        Web Farm Id :
        <asp:Label ID="lblWebFarm" runat="server" Text=""></asp:Label>
    </div>
    <br />
    <div runat="server" id="divCacheHit" visible="false">
        <div style="background-color: Green; padding: 5px;">
            <asp:Label ID="lblCacheHit" ForeColor="White" Font-Bold="true" runat="server" Text="Cache Hit"></asp:Label>
        </div>
        <br />
        <div>
            <asp:Label ID="lblCacheHitInfo" Font-Bold="true" runat="server" Text="Data available in MyCache."></asp:Label> 
            <asp:Label ID="lblCacheRetrievalTime" runat="server"></asp:Label> 
        </div>
        <br />
        <div>
            <asp:Label ID="lblData" Font-Italic="true" runat="server"></asp:Label>
        </div>
    </div>
    <div runat="server" id="divCacheMiss" visible="false">
        <div style="background-color: Red; padding: 5px;">
            <asp:Label ID="lblCacheMiss" ForeColor="White" Font-Bold="true" runat="server" Text="Cache Miss"></asp:Label>
        </div>
        <br />
        <div>
            <asp:Label ID="lblCacheMissInfo" runat="server" Font-Bold="true" Text="Data not available in MyCache."></asp:Label> Read following data from system and put in MyCache
        </div>
        <br />
        <div>
            <asp:Label ID="lblData2" Font-Italic="true" runat="server"></asp:Label>
        </div>
    </div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder SmartAspects
Bangladesh Bangladesh
I write codes to make life easier, and that pretty much describes me.

Comments and Discussions