SlideShare a Scribd company logo
ASP.NET 4.0 Cache Extensibility	Stefan SchackowProgram Manager	Microsoft CorporationPC41
What's the current state?Why is it changing?How are we changing it?.NET Framework Caching
A great in-memory object cache in ASP.NETLots of configurable "knobs"Expiration policiesAutomatic scavenging behaviorBefore and after removal callbacksExtensible cache dependenciesOutput caching of ASP.NET contentPages Fragment caching of ASP.NET controlsDonut caching with cache substitutionOutput caching of arbitrary HTTP responseCurrent Cache Functionality
In-memory cache has various constraintsObject cache API exists in System.WebAwkward to use object cache outside of ASP.NETCommon question:  Why do I have to include System.Web.dll in my WPF/Winforms project?Not available in 3.5 SP1 Client SKUCaching is a "black box"Where can vendors and developers plugin?Memcached, Velocity, ScaleOut, etc… have no clean integration point available to themOutput caching is completely opaqueEach custom caching solution is a completely different API for developers to learnWhy Make Changes?
Proposed New Cache FunctionalityA new, extensible, object cache API in its own namespace and assemblySupports both client and server applicationsCan be made available on both desktop and client SKUsA factored version of the ASP.NET cache engineExtensible ASP.NET output cachingConsistent APIs for programming againstDisk-based output cachesCustom object cachesCloud-based object cachesDistributed object caches
New 4.0 Cache FunctionalityNamespace System.Caching{In-memoryDisk basedCacheWindows AzureCacheProviderDistributed}
New 4.0 Cache FunctionalityNamespace System.Caching{CacheItemPolicy(expirations, priority, callbacks)CacheItemCacheCacheItemCacheItemCacheDependency(Sql, Key-based, File)}
Object Cachingdemo
New 4.0 Output Cache FunctionalityNamespace System.Web.Caching{Default.aspxIn-memoryDisk basedFoo.ascxWindows AzureOutputCacheProviderDistributed}
Output Cachingdemo
Core Versus Optional APIsCache API is a "union" of common functionalityNot all cache providers need to implement all featuresCore functionality for all providersRepresented on CacheProvider base typeStoring and retrieving a key-value pairBasic Add/Get/Set/Contains/Remove methodsNamed cache partitionsProviders specialize by deriving fromInMemoryCacheProviderOutOfProcessCacheProvider
InMemoryCacheProviderRepresents a provider running exclusively in a single app-domainCount of items in cacheSliding expirationsDistributed caches usually can't synchronize sliding expiration values across multiple serversCache dependencies (derivations of CacheDependency)Distributed caches may have no concept of dependenciesItem removal callbacks (before and after removal)Distributed caches may not be able to call back to anything
OutOfProcessCacheProviderRepresents a provider that stores data outside of an app-domainVersion-based updates (CacheItem.Version)Useful for caches that support optimistic concurrencyLock-based updates (CacheItem.LockHandle)If a cache supports pessimistic concurrencyGet multiple itemsSaves multiple round-trips on fetchesQuery-tag metadata (CacheItem.QueryTags)Retrieving multiple cache items based on string tags
"Velocity" Integration"Velocity" – codename for distributed cache created by the Sql Server teamPlanned "Velocity" integration pointsOutOfProcessCacheProvider implementation for object cachingSessionStateStoreProviderBase implementation for ASP.NET session stateSidenote:  Updates to session state API are planned in 4.0 to allow for more granular sets and gets.OutputCacheProvider implementation for ASP.NET output caching
Checking cache capabilitiesdemo
Migrating From Existing APIsSystem.Web.Caching.CacheCurrent plan is that it stays un-changedMight enable "opting-in" to using an object cache providerRequires developing a “shim” that can re-route calls to the new object cache provider layerCurrently the “shim” is only in the “idea phase”ASP.NET output cachingBoth page and control caching can opt-in to using custom providersBy default both types of output caching continue to use ASP.NET’s in-memory cache
Migrating From Existing APIsASP.NET control output caching<@OutputCacheoutputCacheProvider="…" />ASP.NET page output cachingProgrammatically choose different providers Override a new method on HttpApplicationHttpApplication.GetOutputCacheProviderNameCustom page output caching supports:Absolute expirationsFile-based dependencies onlyValidation and substitution callbacks must be static
Migrating From Existing APIs
Summary4.0 Caching is all about extensibility!Both object caching and ASP.NET output caching will be pluggableNew object cache APIs available for both client and full versions of .NET Framework
Related ContentBreakout Sessions/Chalk TalksPC21 – ASP.NET MVCPC30 – ASP.NET Dynamic DataPC31 – ASP.NET and JqueryPC32 – ASP.NET Ajax FuturesPC33 – Microsoft Visual Studio: Easing ASP.NET WebDevPC41 – ASP.NET Cache ExtensibilityTL48 – Microsoft Visual Studio: Web Development FuturesES15 – Deploying Web Applications with Microsoft Internet Information Services 7.0 and the Web Deployment Tool
Evals & RecordingsPlease fill out your evaluation for this session at:This session will be available as a recording at:www.microsoftpdc.com
Please use the microphones providedQ&A
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation.  Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.   MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
ASP.NET 4.0 Cache Extensibility

More Related Content

PPTX
EPiServer Deployment Tips & Tricks
PDF
JEE Programming - 08 Enterprise Application Deployment
PPTX
Cloud-Based Dev/Test Environments for SharePoint using CloudShare
PDF
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
PDF
Servlet 3.1
ODP
eXo Platform SEA - Play Framework Introduction
PDF
JEE Programming - 05 JSP
PDF
Glassfish JEE Server Administration - JEE Introduction
EPiServer Deployment Tips & Tricks
JEE Programming - 08 Enterprise Application Deployment
Cloud-Based Dev/Test Environments for SharePoint using CloudShare
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Servlet 3.1
eXo Platform SEA - Play Framework Introduction
JEE Programming - 05 JSP
Glassfish JEE Server Administration - JEE Introduction

What's hot (20)

PPTX
Boost Your Content Strategy for REST APIs with Gururaj BS
PPT
Apache Tomcat 7 by Filip Hanik
PDF
11g r2 flashcache_Tips
PDF
Advanced Java
PPT
Module Owb Advanced Features
PDF
.NET Core, ASP.NET Core Course, Session 1
PPT
Java Servlets
PDF
"Building intuitive command-line interfaces in .NET", Alex Thissen
PPT
Shopzilla On Concurrency
PDF
Tomcat Optimisation & Performance Tuning
PDF
.NET Core, ASP.NET Core Course, Session 6
PPT
Shopzilla On Concurrency
PDF
Servlets lecture1
PDF
Architecting Large Enterprise Java Projects
PDF
Jsp servlets
PDF
Java troubleshooting thread dump
PDF
Testing Web Apps with Spring Framework 3.2
PDF
RESTful web service with JBoss Fuse
PDF
Testing Web Apps with Spring Framework
Boost Your Content Strategy for REST APIs with Gururaj BS
Apache Tomcat 7 by Filip Hanik
11g r2 flashcache_Tips
Advanced Java
Module Owb Advanced Features
.NET Core, ASP.NET Core Course, Session 1
Java Servlets
"Building intuitive command-line interfaces in .NET", Alex Thissen
Shopzilla On Concurrency
Tomcat Optimisation & Performance Tuning
.NET Core, ASP.NET Core Course, Session 6
Shopzilla On Concurrency
Servlets lecture1
Architecting Large Enterprise Java Projects
Jsp servlets
Java troubleshooting thread dump
Testing Web Apps with Spring Framework 3.2
RESTful web service with JBoss Fuse
Testing Web Apps with Spring Framework
Ad

Similar to ASP.NET 4.0 Cache Extensibility (20)

PPT
NCache 3.8 SP3
PPT
2310 b 15
PPT
2310 b 15
PPTX
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
PPTX
Windows Server AppFabric Caching - What it is & when you should use it?
PPT
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
PPT
Four Ways to Improve ASP .NET Performance and Scalability
PDF
Developing High Performance and Scalable ColdFusion Application Using Terraco...
PDF
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
PDF
Building High Performance and Scalable Applications Using AppFabric Cache- Im...
PDF
Caching objects-in-memory
PPTX
Microsoft Windows Server AppFabric
PPT
aksdfhaskdjfhasdjkh
PPT
askldjfhaskdfj aslkdjfhaskdfhasjk askldf ashkdf
PPT
aergserga
PPT
salkdjfhdjkghdfkjh
PPT
awergaezrg
PPT
sergaerwga
PPT
sakdjfhaksjfhaskjh
DOCX
sample1
NCache 3.8 SP3
2310 b 15
2310 b 15
TechDays 2010 Portugal - Scaling your data tier with app fabric 16x9
Windows Server AppFabric Caching - What it is & when you should use it?
Varnish and Drupal- Accelerating Website Performance and Flexibility with Var...
Four Ways to Improve ASP .NET Performance and Scalability
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Building High Performance and Scalable Applications Using AppFabric Cache- Im...
Caching objects-in-memory
Microsoft Windows Server AppFabric
aksdfhaskdjfhasdjkh
askldjfhaskdfj aslkdjfhaskdfhasjk askldf ashkdf
aergserga
salkdjfhdjkghdfkjh
awergaezrg
sergaerwga
sakdjfhaksjfhaskjh
sample1
Ad

More from akrakovetsky (17)

PPTX
Alco calculator
PPTX
qiss.IM - wp7rocks.com
PPTX
Семантический HTML5 - iForum
PPTX
Что нового в Visual Studio 2010 и .Net 4.0
PPTX
Dependency Injection на примере Unity и NInject
PPTX
jQuery для ASP.NET разработчиков
PPTX
Функциональное программирование на F#
PPT
Переходим на Windows 7 и Windows 2008 R2
PPTX
Разработка и раскрутка iPhone приложений "с нуля"
PPT
Основи розробки ігор на платформі XNA
PPT
PPTX
Введение в Microsoft Silverlight 3.0
PPTX
Microsoft .NET User Group Вінниця #4
PPT
What's new in Visual Studio 2010.
PPTX
Что нового в ASP.NET 4
PPSX
Введение в Windows Communication Foundation
PPTX
Microsoft User Group Vinnitsya
Alco calculator
qiss.IM - wp7rocks.com
Семантический HTML5 - iForum
Что нового в Visual Studio 2010 и .Net 4.0
Dependency Injection на примере Unity и NInject
jQuery для ASP.NET разработчиков
Функциональное программирование на F#
Переходим на Windows 7 и Windows 2008 R2
Разработка и раскрутка iPhone приложений "с нуля"
Основи розробки ігор на платформі XNA
Введение в Microsoft Silverlight 3.0
Microsoft .NET User Group Вінниця #4
What's new in Visual Studio 2010.
Что нового в ASP.NET 4
Введение в Windows Communication Foundation
Microsoft User Group Vinnitsya

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
cuic standard and advanced reporting.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
KodekX | Application Modernization Development
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
cuic standard and advanced reporting.pdf
sap open course for s4hana steps from ECC to s4
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
KodekX | Application Modernization Development
Encapsulation_ Review paper, used for researhc scholars
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

ASP.NET 4.0 Cache Extensibility

  • 1. ASP.NET 4.0 Cache Extensibility Stefan SchackowProgram Manager Microsoft CorporationPC41
  • 2. What's the current state?Why is it changing?How are we changing it?.NET Framework Caching
  • 3. A great in-memory object cache in ASP.NETLots of configurable "knobs"Expiration policiesAutomatic scavenging behaviorBefore and after removal callbacksExtensible cache dependenciesOutput caching of ASP.NET contentPages Fragment caching of ASP.NET controlsDonut caching with cache substitutionOutput caching of arbitrary HTTP responseCurrent Cache Functionality
  • 4. In-memory cache has various constraintsObject cache API exists in System.WebAwkward to use object cache outside of ASP.NETCommon question: Why do I have to include System.Web.dll in my WPF/Winforms project?Not available in 3.5 SP1 Client SKUCaching is a "black box"Where can vendors and developers plugin?Memcached, Velocity, ScaleOut, etc… have no clean integration point available to themOutput caching is completely opaqueEach custom caching solution is a completely different API for developers to learnWhy Make Changes?
  • 5. Proposed New Cache FunctionalityA new, extensible, object cache API in its own namespace and assemblySupports both client and server applicationsCan be made available on both desktop and client SKUsA factored version of the ASP.NET cache engineExtensible ASP.NET output cachingConsistent APIs for programming againstDisk-based output cachesCustom object cachesCloud-based object cachesDistributed object caches
  • 6. New 4.0 Cache FunctionalityNamespace System.Caching{In-memoryDisk basedCacheWindows AzureCacheProviderDistributed}
  • 7. New 4.0 Cache FunctionalityNamespace System.Caching{CacheItemPolicy(expirations, priority, callbacks)CacheItemCacheCacheItemCacheItemCacheDependency(Sql, Key-based, File)}
  • 9. New 4.0 Output Cache FunctionalityNamespace System.Web.Caching{Default.aspxIn-memoryDisk basedFoo.ascxWindows AzureOutputCacheProviderDistributed}
  • 11. Core Versus Optional APIsCache API is a "union" of common functionalityNot all cache providers need to implement all featuresCore functionality for all providersRepresented on CacheProvider base typeStoring and retrieving a key-value pairBasic Add/Get/Set/Contains/Remove methodsNamed cache partitionsProviders specialize by deriving fromInMemoryCacheProviderOutOfProcessCacheProvider
  • 12. InMemoryCacheProviderRepresents a provider running exclusively in a single app-domainCount of items in cacheSliding expirationsDistributed caches usually can't synchronize sliding expiration values across multiple serversCache dependencies (derivations of CacheDependency)Distributed caches may have no concept of dependenciesItem removal callbacks (before and after removal)Distributed caches may not be able to call back to anything
  • 13. OutOfProcessCacheProviderRepresents a provider that stores data outside of an app-domainVersion-based updates (CacheItem.Version)Useful for caches that support optimistic concurrencyLock-based updates (CacheItem.LockHandle)If a cache supports pessimistic concurrencyGet multiple itemsSaves multiple round-trips on fetchesQuery-tag metadata (CacheItem.QueryTags)Retrieving multiple cache items based on string tags
  • 14. "Velocity" Integration"Velocity" – codename for distributed cache created by the Sql Server teamPlanned "Velocity" integration pointsOutOfProcessCacheProvider implementation for object cachingSessionStateStoreProviderBase implementation for ASP.NET session stateSidenote: Updates to session state API are planned in 4.0 to allow for more granular sets and gets.OutputCacheProvider implementation for ASP.NET output caching
  • 16. Migrating From Existing APIsSystem.Web.Caching.CacheCurrent plan is that it stays un-changedMight enable "opting-in" to using an object cache providerRequires developing a “shim” that can re-route calls to the new object cache provider layerCurrently the “shim” is only in the “idea phase”ASP.NET output cachingBoth page and control caching can opt-in to using custom providersBy default both types of output caching continue to use ASP.NET’s in-memory cache
  • 17. Migrating From Existing APIsASP.NET control output caching<@OutputCacheoutputCacheProvider="…" />ASP.NET page output cachingProgrammatically choose different providers Override a new method on HttpApplicationHttpApplication.GetOutputCacheProviderNameCustom page output caching supports:Absolute expirationsFile-based dependencies onlyValidation and substitution callbacks must be static
  • 19. Summary4.0 Caching is all about extensibility!Both object caching and ASP.NET output caching will be pluggableNew object cache APIs available for both client and full versions of .NET Framework
  • 20. Related ContentBreakout Sessions/Chalk TalksPC21 – ASP.NET MVCPC30 – ASP.NET Dynamic DataPC31 – ASP.NET and JqueryPC32 – ASP.NET Ajax FuturesPC33 – Microsoft Visual Studio: Easing ASP.NET WebDevPC41 – ASP.NET Cache ExtensibilityTL48 – Microsoft Visual Studio: Web Development FuturesES15 – Deploying Web Applications with Microsoft Internet Information Services 7.0 and the Web Deployment Tool
  • 21. Evals & RecordingsPlease fill out your evaluation for this session at:This session will be available as a recording at:www.microsoftpdc.com
  • 22. Please use the microphones providedQ&A
  • 23. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.