IT Community - Software Programming, Web Development and Technical Support

What are the Types of caching in dot net 2005?

This is a discussion on What are the Types of caching in dot net 2005? within the ASP and ASP.NET Programming forums, part of the Web Development category; What are the Types of caching in dot net 2005?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-25-2007, 03:50 AM
Archer Archer is offline
D-Web Programmer
 
Join Date: Jun 2007
Posts: 52
Archer is on a distinguished road
Question What are the Types of caching in dot net 2005?

What are the Types of caching in dot net 2005?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-25-2007, 03:51 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: What are the Types of caching in dot net 2005?

ASP.NET supports three types of caching for Web-based applications:
• Page Level Caching (called Output Caching)
• Page Fragment Caching (often called Partial-Page Output Caching)
• Programmatic or Data Caching
Output Caching
Page level, or output caching, caches the HTML output of dynamic requests to ASP.NET Web pages. The way ASP.NET implements this (roughly) is through an Output Cache engine. Each time an incoming ASP.NET page request comes in, this engine checks to see if the page being requested has a cached output entry. If it does, this cached HTML is sent as a response; otherwise, the page is dynamically rendered, it's output is stored in the Output Cache engine.

Partial-Page Output CachingPartial-Page Output Caching, or page fragment caching, allows specific regions of pages to be cached. ASP.NET provides a way to take advantage of this powerful technique, requiring that the part(s) of the page you wish to have cached appear in a User Control. One way to specify that the contents of a User Control should be cached is to supply an OutputCache directive at the top of the User Control. That's it! The content inside the User Control will now be cached for the specified period, while the ASP.NET Web page that contains the User Control will continue to serve dynamic content. (Note that for this you should not place an OutputCache directive in the ASP.NET Web page that contains the User Control - just inside of the User Control.)

Data Caching
Sometimes, more control over what gets cached is desired. ASP.NET provides this power and flexibility by providing a cache engine. Programmatic or data caching takes advantage of the .NET Runtime cache engine to store any data or object between responses. That is, you can store objects into a cache, similar to the storing of objects in Application scope in classic ASP. (As with classic ASP, do not store open database connections in the cache!)
Realize that this data cache is kept in memory and "lives" as long as the host application does. In other words, when the ASP.NET application using data caching is restarted, the cache is destroyed and recreated. Data Caching is almost as easy to use as Output Caching or Fragment caching: you simply interact with it as you would any simple dictionary object.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-07-2007, 03:15 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default Re: What are the Types of caching in dot net 2005?

How can you cache different version of same page using ASP.NET cache object?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-07-2007, 04:43 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Default Re: What are the Types of caching in dot net 2005?

Output cache functionality is achieved by using “OutputCache” attribute on ASP.NET page header. Below is the syntax.

<%@ OutputCache Duration="20" Location="Server" VaryByParam="state"
VaryByCustom="minorversion" VaryByHeader="Accept-Language"%>

VaryByParam :- Caches different version depending on input parameters send
through HTTP POST/GET.

VaryByHeader:- Caches different version depending on the contents of the
page header.

VaryByCustom:-Lets you customize the way the cache handles page variations
by declaring the attribute and overriding the GetVaryByCustomString handler.

VaryByControl:-Caches different versions of a user control based on
the value of properties of ASP objects in the control.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-07-2007, 05:45 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Default Re: What are the Types of caching in dot net 2005?

Hi,
Can u tel me, what is meant by caching in dot net 2005, where is it used?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 08-07-2007, 06:29 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Default Re: What are the Types of caching in dot net 2005?

Hi buddy...,

Caching is an important concept in computing. When applied to ASP.NET, it can greatly enhance the performance of your Web applications
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-08-2007, 02:23 AM
krishnakumar krishnakumar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 206
krishnakumar is on a distinguished road
Default Re: What are the Types of caching in dot net 2005?

Hi guys,

I got an idea about cache in dotnet... Now i want to know about Cache Callback in Cache... Can anyone clear me....
__________________
Krishnakumar.S
Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 08-08-2007, 07:07 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: What are the Types of caching in dot net 2005?

Hi,


can you ask your task little more specific. like which type of caching you are going to use, and where you struck in.


thanks...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 08-08-2007, 07:47 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: What are the Types of caching in dot net 2005?

Cache object is dependent on its dependencies example like file based, time based etc...Cacheitems remove the object when cache dependencies change.i think ASP.NET provides capabilityto execute a callback method when that item is removed from cache.
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 08-10-2007, 03:12 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Need Help ,for user specific Cache...

I need help for user specific Cache...

We have a web application, where we use the session to store the user specific
data,and also we have datagrids which has paging and using Dataset stored in
session.since these dataset r holding large amount of data ie about 1000 recs min ,
and v have such datagrids throught the application ,according to the customer
request.

We r planning to replace the session object by Cache object. since all these
data are user specific, and the Cache object is of Application scope,Can u suggest
me the methods the keep these cache items user specific.

I planned to concatnate the session id with the cache item name,so when accesed the cache item created by the user will be unique.
Is there any other method to make cache items user specific.


thnx...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 08-10-2007, 03:16 AM
Venkat Venkat is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 350
Venkat is on a distinguished road
Thumbs up Re: What are the Types of caching in dot net 2005?

Hi,

Does your application need the user data to be cached even after the session is closed? If this is not a case, store data in Session rather than in Cache.
You said that you will be appending the sessionid to the cache item name, which means that the data is not useful once the session is closed. So, storing data in cache unnecessary, as it is application scope increases load at the server. So, rethink about storing data in Cache object. Better store data in Session Object.

You can access data from the database instead of storing it in Session also. But, the tradeoff is between at how many places does you need this data. If it is required at fewer places (<15) for a huge application, then better go for DB every time. But, you need to consider the amount of other data storing in session. Also, consider the number of users accessing your site simulatenously. Because, if you are storing data in session and number of people accessing the site is hight, then you can get memory problems.
__________________
Venkat
knowledge is Power
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 08-14-2007, 03:50 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: What are the Types of caching in dot net 2005?

Hi Venkat,

thanks for your reply, i need little clarification on it. I will use the session.
My doubt is where these values will be stored in server and is any difference between these in performance....


thangs again venkat....


thnx....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 08-18-2007, 03:00 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Difference between cache and Session in dot net

Hi venkat,

i got the difference between cache and session and here it is.


Cache: The concept of Caching used in case of Performance Improvement.When web pages do not frequently change we use the concept of caching.All the object stores in the

memory .There are two types of caching 1) output caching 2)Fragment Caching .

it basically reduce the load of web site.

Session: Session object is basically used for Specific User and maintains its state.The

default Timeout is 20 minute but you can reset the time ,you can store any

object in session and also remove it.

Ex: Session["mysession"] = "This is my Session"


thnx...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/asp-asp-net-programming/2712-what-types-caching-dot-net-2005-a.html
Posted By For Type Date
What are the Types of caching in dot net 2005? | Web Hosting This thread Refback 01-09-2008 11:47 PM
DiscussWeb IT Community - Fusing This thread Refback 08-08-2007 07:32 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Explain how Caching in Asp.net 2.0 is different from Caching in Asp.net 1.1? Arun ASP and ASP.NET Programming 6 09-19-2007 10:15 PM
Caching in php abhilashdas PHP Programming 1 08-06-2007 11:42 PM
I Cannot access SQL 2005 integrated services after installing SQL-2005..? theone Database Support 1 07-27-2007 01:12 AM
How many types of authentication modes are there and what are the Types.... Archer ASP and ASP.NET Programming 1 07-25-2007 03:48 AM
ASP Caching nhoj ASP and ASP.NET Programming 0 04-09-2007 09:12 AM


All times are GMT -7. The time now is 08:23 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0