Caching Enhancement in ASP.NET 4.0
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Caching Enhancement in ASP.NET 4.0

  • 6,054 views
Uploaded on

Caching Enhancement in ASP.NET 4.0

Caching Enhancement in ASP.NET 4.0

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • 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.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
6,054
On Slideshare
4,931
From Embeds
1,123
Number of Embeds
2

Actions

Shares
Downloads
114
Comments
1
Likes
3

Embeds 1,123

http://abhijitjana.net 1,117
url_unknown 6

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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