Cache and Cookies Introduction Guide

Cache and Cookies Introduction Guide

Caching of a web-page or data used for performance- enhancement of a web server. Caching can be done at client’s machine as well as at server.

Client-side Cache can be classified into three – types.

1. Page Cache: Entire page including all static contents, server controls, user controls will be cached.

2. Fragment Cache: Only a portion of the web-page identified as a User Control can be cached.

3. Data Cache: Caching of any in-memory data object like Array, ArrayList, DataSet, DataTable, DataView etc.

For Page Cache & Fragment Cache,<%@ OutputCache directive is used.

For Data Cache, Cache intrinsic object is used.

<%@ OutputCache  Duration=”10″ VaryByParam=”None | ColName | *”

or

VaryByControl=”None | ColName | *” Location=”Any | Server | Client | ServerAndClient | DownStream | None”%>

Cache Intrinsic Object

System.Web.Caching Namespace

– Cache  class

– Remove(“CacheName”)  method

Difference between Cookie and Cache

Cookie

1. A persistent cookie can be saved at client’s machine ONLY. It is saved as a text file.

2. Maximum size of a cookie depends on the browser. In IE6, it is 8KB.

3. A persistent cookie can be saved at client’s for a long period of months.

4. A cookie can be regulated at client’s browser.

Cache

1. A Cache can be put at client’s machine as well as at server. It is put in RAM[Physical Memory], very volatile.

2. There is no maximum size for a cache. It depends on the size of the web page.

3. Cache is kept for very short duration. Often calculated in seconds.

4. A cache cannot be regulated by client’s browser.

Application Memory – Primary memory allocated to run an application in a computer system.

Buffered Memory – Memory allocated at run-time for some extra processing. ie. loading a file.

In mother board,

L2, L3, L4 Cache – 512 KB                [SRAM – Static RAM]

Cache – Caching of application data at run-time for an application.[in Physical Memory].

Thanks for your attentions

Related Information

ASP.NET Cache

ASP.NET Cookies Overview

Beginner’s Guide to ASP.NET Cookies

* Cache and Cookies Introduction Guide

About

Hi, This is R K Gupta, an IT professional and Entrepreneur. I have written many articles yet for my websites gsesoftsolutions.com, Hope you like it. Kindly subscribe our feed for any updates. Add me in Facebook and Google+

Posted in Microsoft .Net Help, Software Development