Your SlideShare is downloading. ×
0
INDIA  │ 9-11 February 2011<br />virtual techdays<br />Caching Enhancement in ASP.NET 4.0<br />Abhijit Jana  │ Consultant,...
INDIA  │  9-11 February 2011<br />virtual techdays<br />S E S S I O N    A G E N D A<br /><ul><li>ASP.NET Caching Quick Tour
Data / Object Caching
Output Caching
Page Caching
Fragment Caching
New Object Caching Option
System.Runtime.Caching
Output Cache Provider in ASP.NET 4.0
Internals of Output Cache Provider
Creating Custom Cache Providers
Limitation
Selecting Cache Provider on the fly</li></li></ul><li>INDIA  │  9-11 February 2011<br />virtual techdays<br />ASP.NET Cach...
It’s a great feature that reduces network latency and
It can improve application's performance considerably.
ASP.NET Caching
Data / Object Caching
Output Caching
Upcoming SlideShare
Loading in...5
×

Caching Enhancement in ASP.NET 4.0

5,597

Published on

Caching Enhancement in ASP.NET 4.0

Published in: Technology
1 Comment
4 Likes
Statistics
Notes
  • Very well presented. No doubt caching is just incredible tool to enhance performance and this is also so true that asp.net cache has some limitations as well. I like to read this type of useful reading material. I read in an article about limitations ( like scalability, data integrity and data consistency) of asp.net cache.
    In order to remove these limitations Distributed Cache (Like NCache, AppFabric) can be used in fact distributed cache would be healthier solution.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
5,597
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
127
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Caching Enhancement in ASP.NET 4.0"

  1. 1. INDIA │ 9-11 February 2011<br />virtual techdays<br />Caching Enhancement in ASP.NET 4.0<br />Abhijit Jana │ Consultant, Microsoft<br />http://abhijitjana.net<br />
  2. 2. INDIA │ 9-11 February 2011<br />virtual techdays<br />S E S S I O N A G E N D A<br /><ul><li>ASP.NET Caching Quick Tour
  3. 3. Data / Object Caching
  4. 4. Output Caching
  5. 5. Page Caching
  6. 6. Fragment Caching
  7. 7. New Object Caching Option
  8. 8. System.Runtime.Caching
  9. 9. Output Cache Provider in ASP.NET 4.0
  10. 10. Internals of Output Cache Provider
  11. 11. Creating Custom Cache Providers
  12. 12. Limitation
  13. 13. Selecting Cache Provider on the fly</li></li></ul><li>INDIA │ 9-11 February 2011<br />virtual techdays<br />ASP.NET Caching Quick Tour<br />Basic of ASP.NET Caching<br /><ul><li>Caching is a technique where frequently used data and Web pages can stored temporarily.
  14. 14. It’s a great feature that reduces network latency and
  15. 15. It can improve application's performance considerably.
  16. 16. ASP.NET Caching
  17. 17. Data / Object Caching
  18. 18. Output Caching
  19. 19. Page Output Caching
  20. 20. Fragment Caching</li></li></ul><li>INDIA │ 9-11 February 2011<br />virtual techdays<br />ASP.NET Caching Quick Tour<br /><ul><li>ASP.NET Caching is Implemented as HTTPModule
  21. 21. Cache Module Listens to all the incoming Request
  22. 22. OutputCacheModule listens to ResolveRquestCache and UpdateRequestCache
  23. 23. Based on the events modules returns the Cached HTML content or moving forward to Page Handler
  24. 24. Cache can have Dependencies
  25. 25. File based dependencies
  26. 26. Time Based dependencies</li></ul>BeginRequest Event<br />AuthenticateRequest Event<br />AuthorizeRequest Event<br />ResolveRequestCache Event<br />Map Request Handler<br />AcquireRequestState Event<br />
  27. 27. INDIA │ │ 9-11 February 2011<br />virtual techdays<br />ASP.NET Data – Object Caching<br />Request For Information<br />Request For Information<br />Cached Data<br />
  28. 28. INDIA │ │ 9-11 February 2011<br />virtual techdays<br />New Object Caching API in ASP.NET 4.0<br /><ul><li>ASP.NET in-memory object cache (System.Web.Caching.Cache) with help of System.Web.dll
  29. 29. Same Cache Object Can be used for Win Forms , WPF based application with reference of System.Web.dll
  30. 30. .NET Framework 4 introduces a new assembly System.Runtime.Caching.dll
  31. 31. The Assembly contains a new caching API in the System.Runtime.Caching namespace.
  32. 32. The new API mainly based on concrete in-memory object cache implementation (System.Runtime.Caching.MemoryCache class).
  33. 33. Win forms, WPF based application can use Caching with just help of System.Runtime.Caching.dll . So, no need to load System.web.dll for non web applications.</li></li></ul><li>INDIA │ 22-24 November2010<br />virtual techdays<br />DEMO: New Object Caching API in ASP.NET 4.0<br />Abhijit Jana│ Consultant, Microsoft<br />
  34. 34. INDIA │ │ 9-11 February 2011<br />virtual techdays<br />ASP.NET Output Caching<br /><ul><li>Caches rendered markup of an ASP.NET page
  35. 35. Caches Complete Rendered Markup
  36. 36. Caches Partial Markup
  37. 37. Caching Substitution
  38. 38. Output caching can be configured based </li></ul> on duration, params<br /><ul><li>Cached version of the page can be sent in</li></ul>response without running the page<br />MSIL<br />JIT Compiler > Native Code > HTML<br />
  39. 39. INDIA │ │ 9-11 February 2011<br />virtual techdays<br />ASP.NET Output Caching Continue…<br />ASPX Content<br />Response<br />Request<br />Response<br />Cached Content<br />Request<br />Web Server<br />Clients<br />
  40. 40. INDIA │ │ 9-11 February 2011<br />virtual techdays<br />ASP.NET Output Caching – Deep Dive<br />1<br />HTTP Module<br />2<br />HTTP Module<br />7<br />6<br />Cached Version<br />HTTP Module<br />Page Class Instance<br />Full Page Cache<br />Partial Page Cache<br />3<br />ASPX Page Handler<br />4<br />ASP.NET Engine<br />5<br />ASP.NET Page<br />
  41. 41. INDIA │ │ 9-11 February 2011<br />virtual techdays<br />ASP.NET Custom Output Cache Provider<br /><ul><li>Output Caches Stored In Memory
  42. 42. Extending ASP.NET Output Caching
  43. 43. Custom Cache Provider
  44. 44. Implements OutputCacheProvider
  45. 45. Add() , Get(), Remove(), Set()
  46. 46. Can be store File System, DB, In Memory, Cloud</li></ul>Cache Provider<br />
  47. 47. INDIA │ 22-24 November2010<br />virtual techdays<br />DEMO: Creating Custom Output Cache Provider<br />Abhijit Jana│ Consultant, Microsoft<br />
  48. 48. INDIA │ │ 9-11 February 2011<br />virtual techdays<br />Limitations<br /><ul><li>Supported File dependencies but no custom dependencies.
  49. 49. Custom Cache providers only supports Absolute expiration . There is no supports for sliding expiration.</li></li></ul><li>INDIA │ │ 9-11 February 2011<br />virtual techdays<br />Selecting Cache Provider On the Fly<br /><ul><li>If you have multiple Cache Provider you can select any of the at runtime based on your requirements.
  50. 50. Can set default Provider.</li></ul>Disk Cache Provider<br />Database Cache Provider<br />Get Cache Provider<br />In Memory Cache ( Default Provider )<br />
  51. 51. INDIA │ 22-24 November2010<br />virtual techdays<br />DEMO: Dynamically Output Cache Provider Selection<br />Abhijit Jana│ Consultant, Microsoft<br />
  52. 52. INDIA │ │ 9-11 February 2011<br />virtual techdays<br />Summarize<br /><ul><li>Caching is a technique where frequently used data and Web pages can stored temporarily.
  53. 53. ASP.NET having Data Caching and Output Caching with Cache Dependency
  54. 54. .NET 4.0 Introduce new Object Caching for ASP.NET 4.0
  55. 55. Using System.Runtime.Caching
  56. 56. Internal of Output Caching in ASP.NET
  57. 57. Creating Custom Cache Provider using OutputCacheProvider
  58. 58. Select Cache Provider on the Fly</li></li></ul><li>INDIA │ 9-11 February 2011<br />virtual techdays<br />Resource<br /><ul><li>Microsoft ASP.NET 4 Core Runtime for Web Developers
  59. 59. Scaling Your Data Tier with Windows Server AppFabric
  60. 60. http://msdn.microsoft.com/en-us/library/dd997357.aspx
  61. 61. http://msdn.microsoft.com/en-us/library/system.runtime.caching.memorycache.aspx</li></li></ul><li>THANKS│ 9-11 February 2011<br />virtual techdays<br />Thank You<br />abhijan@microsoft.com │ http://abhijitjana.net│ @AbhijitJana<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×