Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 17th, 2004, 08:00 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default .NEt Caching

One of the new features in ASP.NET is a system for caching page and application data, so that you don’t have to perform the same expensive process every time someone views a page.

Page caching: Caching can be performed on a per-page basis, or on a per-user-control basis, letting you store part or whole pages in a cache, and customise their expiration.

Page caching is controlled by the <%@ OutputCache %> directive, which has two compulsory parameters: · Duration: The number of seconds to keep the page in the cache · VaryByParam: The query string parameters to use when determining page uniqueness. For example, news articles may have urls like news.aspx?id=2, news.aspx?id=3. In this case, you would want to store a different entry in the cache for news article 2 than for article 3, so you could vary by the “id” parameter.

Object caching: You can insert a value into the Cache object giving it a unique key and set its absolute or relative expiration time.

For example, we may want to cache some xml resulting from a complicated process, and store it for 12 hours. Each time we use the xml we check if it’s still in the cache:

Prioritise items in the cache: Because the cache stores items in memory, it may need to boot out some items to free up memory. Each time you insert something into the cache, use the overloaded version of Insert that allows you to indicate how important that item is, using one of the CacheItemPriority enumeration values.

Don’t cache everything: Again, because the cache is in-memory, you need to trade-off whether to regenerate items, or store them in memory.

Single point of maintenance: No-one wants to dig through code to find cache settings, so the usual rule applies here. You’ll find it easier in the long run if you store your cache settings in a central location.


Please provide your feedback as this would enable me and encourage me in posting some articles for everyone here.

Thanks
Srimahavishnu Vadlapatla
( Mahavishnu / Vishnu)
__________________
Thanks!
Srimahavishnu Vadlapatla
(Mahavishnu / Vishnu)
&nbsp;E-Mail Me
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.Net Caching sohrabus ASP.NET 2.0 Professional 1 January 26th, 2007 11:29 AM
Caching in .NET derekl ASP.NET 1.0 and 1.1 Basics 1 August 21st, 2006 11:05 AM
.NET|Issue with .aspx pages caching at Server side purtimalhotra ASP.NET 1.0 and 1.1 Professional 0 July 6th, 2006 12:13 AM
Plz explain .NET Caching Options ? amitjoshipune .NET Framework 2.0 0 March 31st, 2005 03:36 AM
Caching in .Net Mahavishnu ASP.NET 1.x and 2.0 Application Design 1 February 17th, 2004 09:07 AM



All times are GMT -4. The time now is 09:00 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.