The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Joys of ASP.NET 2.0 - Series - Part 2 from PDC

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Sudhakar Sadasivuni

Posts: 418
Nickname: sadasivuni
Registered: Nov, 2003

Sudhakar Sadasivuni is a Microsoft .NET MVP, a project engineer for Wipro technologies.
Joys of ASP.NET 2.0 - Series - Part 2 from PDC Posted: Nov 12, 2003 1:38 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Sudhakar Sadasivuni.
Original Post: Joys of ASP.NET 2.0 - Series - Part 2 from PDC
Feed Title: {Sudhakar's .NET Dump Yard;}
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/ssadasivuni/rss.aspx
Feed Description: using Sudhakar.Dotnet.Blog.Main;
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Sudhakar Sadasivuni
Latest Posts From {Sudhakar's .NET Dump Yard;}

Advertisement

excerpt from Bill's Notes

Rob Howard – WSV330 – ASP.NET Programming Using Advanced Caching Techniques in ASP.NET Whidbey

 

Program Manager, Web Platform & Tools

 

http://www.asp.net/whidbey to download the slides

http://weblogs.asp.net/rhoward

 

ASP.NET 1.X Output Cache

  • Page Output Caching
    • Cache contents of page to memory
    • Reused cached page on subsequent requests
    • Supported HTTP 1.1 Cache semantics
  • Partial Page Caching
    • Cached User Control in a page
    • Allowed for portions of page to be cached
    • Time based dependencies
  • Programmatic Cache API
    • Cache objects in memory
    • Same cache used for Output Caching
  • Dependencies
    • Time, Key, File
    • Remove items when dependency changes
  • Removal event 

ASP.NET 2.0 Cache

  • Most requested Cache features
    • Support database invalidation
    • Create your own dependencies
  • We listened…
    • Added SQL 7/2000/’Yukon’ cache invalidation 

SqlCacheDependency

System.Web.Caching

  • SQL 7 & 2000 Support
    • Table change dependencies on SQL 7 & 2000
    • Requires configuration settings
    • One-time setup of SQL Server database
    • Polling model
  • SQL Server “Yukon”
    • Result Set dependencies for SQL Yukon
    • Supported through ADO.NET SqlCommand
    • No setup required
    • Notification model 

SQL Yukon – push based model. Yukon will detect when changes occur and will push to ASP.NET … other databases use a polling method.

 

SQL 7 & 2000 require a one-time setup … create a table in the database and some stored procedures. SQL Yukon – no setup required.

 

SQL 7 & 2000

  • Table level notifications only
    • Notification when data in table changes
    • Row-level notification is not supported
  • Requires one time setup of SQL 7/2000
    • Triggers on tables that participate
    • Stored procedures called to check
  • Of Note:
    • Entries in cache table <# of tables in DB
    • Entries in cache = # items in cache table 

New attribute in the output directive – sqldependency=”MyDatabase:Products”

 

In the web.config:

  

  

 

Cache.Insert(cacheKey, dataset, New SqlCacheDependency(“ACME”, “Products”))

 

There is no Oracle cache dependency. We don’t know if we want to build one – all because of time constraints. You can build your own though. Easy to do.

 

Behind the scenes: When we do this polling, we do not do this on your request thread, therefore there is no overhead on the polling.

 

Dim d as New SqlCacheDependency()

 

How does this all work? We use a tool aspnet_regsqlcache.exe – this is going to go away in the beta. Set up your database. Creates table. Trigger created. Created dataset and page and we begin monitoring. You update to a table is causing the trigger to change the SqlCD table and then your asp.net page knows to use the new data.

 

Enabling SQL 7 & 2000

  • Alpha – Command Line only
    • Aspnet_regsqlcache.exe
  • Beta – Command Line and Wizard
    • Rolled into aspnet_regsql.exe 

Enabling the table and the database are two separate and distinct things.

 

configuration – only for sql server 7 and 2000

  • Relates friendly name to connection string
  • Control default polling settings 

pollTime attribute causes the refresh of the polling. This is optional.

 

  • section
    • Identify connection string 

SQL Server ‘Yukon’

  • Granular Notification Support
    • Ex., when data in table changes
    • Ex., when SPROC results change
  • Built in feature of the database
    • No triggers or other services to install
    • Pushes changes to subscribers
  • ADO.NET SqlCommand
    • Supported by Yukon only

This works in a web garden as well.

 

CacheDependency Changes

  • No breaking changes to CacheDependency
    • Backwards compatible with v1.x code
  • ASP.NET 2.0 CacheDependency class:
    • New virtual properties/methods 

New APIs

 

ASP.NET 2.0

  • Post-Cache Substitution
    • Ouput cache entire page
    • Identify regions that are dynamic
  • Uses a PlaceHolder buffer
  • New Response.WriteSubstitution()
    • Wires up substitution event on page
    • Adds a substitution buffer to the response
    • Substitution event returns string value to add
  • New control
    • Drag and drop anywhere content should go.

Read: Joys of ASP.NET 2.0 - Series - Part 2 from PDC

Topic: Looking for Photos of .NET Rocks at PDC Previous Topic   Next Topic Topic: Emancipation...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use