SlideShare uma empresa Scribd logo
1 de 15
ASP.NET Caching
Presenter: Vikash Kumar, Mindfire Solutions
Agenda
●
Basics of ASP.NET Caching
●
Types of Caching
●
Output Caching
●
Full Page Caching
●
Partial (Fragment) Caching
●
Application (Object) Caching
●
System.Runtime.Caching
●
Custom cache providers
●
Some other caching techniques
●
Caching consideration
Basics of ASP.NET Caching
●
Caching is a technique to save frequently
used data into into temporary location.
●
Improves application performance.
●
Reduce a lot of server resources at peak
times.
●
Types of Caching
◦ Output Caching
●
Full Page Caching
●
Partial (Fragment caching)
◦ Application (Object) caching
Output Caching
●
Output caching enable to store rendered
HTML.
●
@ OutputCache directive is used to cache.
●
OutputCache attributes:
◦ Duration (time duration in seconds)
◦ VaryByParam (Cache by parameters)
◦ VaryByControl (Cache by controls)
◦ VaryByHeader (Cache by header Ex: User-Agent)
◦ VaryByCustom (GetVaryByCustomString on
Global.asax)
Output Caching...
●
OutputCache attributes:
◦ VaryByContentEncoding ( Ex: text/plain , text/html )
◦ Location
●
Server ( Output is saved under Web server memory )
●
Downstream ( Header is added to response to cache
on proxy server )
●
Client ( Header is added to response to cache on page
level )
●
Any ( Could be stored on any location ) - Default
●
None ( No caching is done )
Fragment Caching
●
Partial-page caching can work through user
control caching and post-cache substitution.
●
A portion of the page get cached.
●
Done through help of user controls or
substitution controls like AdRotator
●
Shared attribute is only available for user
control for sharing cache across multiple
pages.
Application/Object Caching
●
The application cache provides a
programmatic way for you to store arbitrary
data in memory using key/value pairs. Using
the application cache is like using application
state.
●
System.Web.Caching assembly
●
Depends upon HttpContext
●
Functions
◦ Cache.Insert
◦ Cache.Add
System.Runtime.Caching
●
System.Web.Caching.Cache is used with help
of System.Web.dll
●
New API came with .NET 4.0 under
System.Runtime.Caching.dll with
System.Runtime.Caching
●
It could be used in Win Forms, WPF etc
without making reference to System.Web.dll
●
The new API is based on in memory cache.
●
Write once and can be used in different .NET
technologies.
Custom Cache Provider
●
Output Caching are in memory.
●
Functionality came with ASP.NET 4.0
●
Implements OutputCacheProvider.
●
Add(), Get(), Set(), Remove() functions are
available for operation
●
Through custom cache provider cache could
be stored in File system, Cloud, database,
memory.
●
Helpful under scavenging process (removing
of cache when server memory is getting low).
Custom Cache Provider...
●
Output Caching are in memory.
●
Functionality came with ASP.NET 4.0
●
Implements OutputCacheProvider.
●
Add(), Get(), Set(), Remove() functions are
available for operation
●
Through custom cache provider cache could
be stored in File system, Cloud, database,
memory.
●
Helpful under scavenging process (removing
of cache when server memory is getting low).
Cache Provider
Add Get Set Remove
DB Files
Cache Provider
Add Get Set Remove
CloudDB Files
Custom Cache Provider...
Other techniques
●
Profile Caching under web.config to be
consistent with different setting.
●
GlobalOutputCacheProviderName in
Global.asax to change cache providers
according to need.
●
SQLCacheDependency has very limited
support and also depends upon SQL
configuration too.
http://blogs.msdn.com/b/tolong/archive/2007/02/16/sql-cache-dependency.aspx
http://www.codeproject.com/Articles/12335/Using-SqlDependency-for-
data-change-events
Caching Consideration
●
Full page caching: If page contents changes
after certain interval.
●
Fragment caching: Some of page contents
remains static but others are frequently
changes.
●
Object caching: Data is accessed frequently
and takes time to load up.
●
Cache dependency: File, Directory or based
on other cache entries.
●
Sliding or Absolute: Sliding, if data is not
changed frequently.
Question and
Answer
Thank you

Mais conteúdo relacionado

Mais procurados (20)

OAuth 2.0
OAuth 2.0OAuth 2.0
OAuth 2.0
 
ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
 
Master pages
Master pagesMaster pages
Master pages
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
 
Rest API
Rest APIRest API
Rest API
 
Asp.net
Asp.netAsp.net
Asp.net
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
Asp net
Asp netAsp net
Asp net
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Node.js Express Framework
Node.js Express FrameworkNode.js Express Framework
Node.js Express Framework
 
CSS
CSSCSS
CSS
 
Introduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityIntroduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring Security
 
Fetch API Talk
Fetch API TalkFetch API Talk
Fetch API Talk
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
Middleware in Asp.Net Core
Middleware in Asp.Net CoreMiddleware in Asp.Net Core
Middleware in Asp.Net Core
 

Semelhante a Asp.net caching

Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsBrettTasker
 
Where is my cache architectural patterns for caching microservices by example
Where is my cache architectural patterns for caching microservices by exampleWhere is my cache architectural patterns for caching microservices by example
Where is my cache architectural patterns for caching microservices by exampleRafał Leszko
 
Archivematica Technical Training Diagnostics Guide (September 2018)
Archivematica Technical Training Diagnostics Guide (September 2018)Archivematica Technical Training Diagnostics Guide (September 2018)
Archivematica Technical Training Diagnostics Guide (September 2018)Artefactual Systems - Archivematica
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Per Henrik Lausten
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetesArchitectural caching patterns for kubernetes
Architectural caching patterns for kubernetesRafał Leszko
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXKevin Jones
 
PLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providers
PLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providersPLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providers
PLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providersPROIDEA
 
Introduction to rook
Introduction to rookIntroduction to rook
Introduction to rookRohan Gupta
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXNGINX, Inc.
 
Where is my cache? Architectural patterns for caching microservices by example
Where is my cache? Architectural patterns for caching microservices by exampleWhere is my cache? Architectural patterns for caching microservices by example
Where is my cache? Architectural patterns for caching microservices by exampleRafał Leszko
 
What’s new in cas 4.2
What’s new in cas 4.2 What’s new in cas 4.2
What’s new in cas 4.2 Misagh Moayyed
 
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)Venugopal Gummadala
 
Where is my cache architectural patterns for caching microservices by example
Where is my cache architectural patterns for caching microservices by exampleWhere is my cache architectural patterns for caching microservices by example
Where is my cache architectural patterns for caching microservices by exampleRafał Leszko
 
ASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache ExtensibilityASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache Extensibilityakrakovetsky
 
Introduction to CloudStack Storage Subsystem
Introduction to CloudStack Storage SubsystemIntroduction to CloudStack Storage Subsystem
Introduction to CloudStack Storage Subsystembuildacloud
 
Seif_mike_gsoc_2014_cloudstack
Seif_mike_gsoc_2014_cloudstackSeif_mike_gsoc_2014_cloudstack
Seif_mike_gsoc_2014_cloudstackseif_100
 
Load testing in Zonky with Gatling
Load testing in Zonky with GatlingLoad testing in Zonky with Gatling
Load testing in Zonky with GatlingPetr Vlček
 
Architectures, Frameworks and Infrastructure
Architectures, Frameworks and InfrastructureArchitectures, Frameworks and Infrastructure
Architectures, Frameworks and Infrastructureharendra_pathak
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopVelocidex Enterprises
 

Semelhante a Asp.net caching (20)

Silverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applicationsSilverstripe at scale - design & architecture for silverstripe applications
Silverstripe at scale - design & architecture for silverstripe applications
 
Where is my cache architectural patterns for caching microservices by example
Where is my cache architectural patterns for caching microservices by exampleWhere is my cache architectural patterns for caching microservices by example
Where is my cache architectural patterns for caching microservices by example
 
Archivematica Technical Training Diagnostics Guide (September 2018)
Archivematica Technical Training Diagnostics Guide (September 2018)Archivematica Technical Training Diagnostics Guide (September 2018)
Archivematica Technical Training Diagnostics Guide (September 2018)
 
Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)Intro to XPages for Administrators (DanNotes, November 28, 2012)
Intro to XPages for Administrators (DanNotes, November 28, 2012)
 
Architectural caching patterns for kubernetes
Architectural caching patterns for kubernetesArchitectural caching patterns for kubernetes
Architectural caching patterns for kubernetes
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
PLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providers
PLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providersPLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providers
PLNOG 4: Leszek Urbański - A modern HTTP accelerator for content providers
 
Introduction to rook
Introduction to rookIntroduction to rook
Introduction to rook
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
Varnish - PLNOG 4
Varnish - PLNOG 4Varnish - PLNOG 4
Varnish - PLNOG 4
 
Where is my cache? Architectural patterns for caching microservices by example
Where is my cache? Architectural patterns for caching microservices by exampleWhere is my cache? Architectural patterns for caching microservices by example
Where is my cache? Architectural patterns for caching microservices by example
 
What’s new in cas 4.2
What’s new in cas 4.2 What’s new in cas 4.2
What’s new in cas 4.2
 
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)
 
Where is my cache architectural patterns for caching microservices by example
Where is my cache architectural patterns for caching microservices by exampleWhere is my cache architectural patterns for caching microservices by example
Where is my cache architectural patterns for caching microservices by example
 
ASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache ExtensibilityASP.NET 4.0 Cache Extensibility
ASP.NET 4.0 Cache Extensibility
 
Introduction to CloudStack Storage Subsystem
Introduction to CloudStack Storage SubsystemIntroduction to CloudStack Storage Subsystem
Introduction to CloudStack Storage Subsystem
 
Seif_mike_gsoc_2014_cloudstack
Seif_mike_gsoc_2014_cloudstackSeif_mike_gsoc_2014_cloudstack
Seif_mike_gsoc_2014_cloudstack
 
Load testing in Zonky with Gatling
Load testing in Zonky with GatlingLoad testing in Zonky with Gatling
Load testing in Zonky with Gatling
 
Architectures, Frameworks and Infrastructure
Architectures, Frameworks and InfrastructureArchitectures, Frameworks and Infrastructure
Architectures, Frameworks and Infrastructure
 
Crikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor WorkshopCrikeycon 2019 Velociraptor Workshop
Crikeycon 2019 Velociraptor Workshop
 

Mais de Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Último

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 

Último (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Asp.net caching

  • 1. ASP.NET Caching Presenter: Vikash Kumar, Mindfire Solutions
  • 2. Agenda ● Basics of ASP.NET Caching ● Types of Caching ● Output Caching ● Full Page Caching ● Partial (Fragment) Caching ● Application (Object) Caching ● System.Runtime.Caching ● Custom cache providers ● Some other caching techniques ● Caching consideration
  • 3. Basics of ASP.NET Caching ● Caching is a technique to save frequently used data into into temporary location. ● Improves application performance. ● Reduce a lot of server resources at peak times. ● Types of Caching ◦ Output Caching ● Full Page Caching ● Partial (Fragment caching) ◦ Application (Object) caching
  • 4. Output Caching ● Output caching enable to store rendered HTML. ● @ OutputCache directive is used to cache. ● OutputCache attributes: ◦ Duration (time duration in seconds) ◦ VaryByParam (Cache by parameters) ◦ VaryByControl (Cache by controls) ◦ VaryByHeader (Cache by header Ex: User-Agent) ◦ VaryByCustom (GetVaryByCustomString on Global.asax)
  • 5. Output Caching... ● OutputCache attributes: ◦ VaryByContentEncoding ( Ex: text/plain , text/html ) ◦ Location ● Server ( Output is saved under Web server memory ) ● Downstream ( Header is added to response to cache on proxy server ) ● Client ( Header is added to response to cache on page level ) ● Any ( Could be stored on any location ) - Default ● None ( No caching is done )
  • 6. Fragment Caching ● Partial-page caching can work through user control caching and post-cache substitution. ● A portion of the page get cached. ● Done through help of user controls or substitution controls like AdRotator ● Shared attribute is only available for user control for sharing cache across multiple pages.
  • 7. Application/Object Caching ● The application cache provides a programmatic way for you to store arbitrary data in memory using key/value pairs. Using the application cache is like using application state. ● System.Web.Caching assembly ● Depends upon HttpContext ● Functions ◦ Cache.Insert ◦ Cache.Add
  • 8. System.Runtime.Caching ● System.Web.Caching.Cache is used with help of System.Web.dll ● New API came with .NET 4.0 under System.Runtime.Caching.dll with System.Runtime.Caching ● It could be used in Win Forms, WPF etc without making reference to System.Web.dll ● The new API is based on in memory cache. ● Write once and can be used in different .NET technologies.
  • 9. Custom Cache Provider ● Output Caching are in memory. ● Functionality came with ASP.NET 4.0 ● Implements OutputCacheProvider. ● Add(), Get(), Set(), Remove() functions are available for operation ● Through custom cache provider cache could be stored in File system, Cloud, database, memory. ● Helpful under scavenging process (removing of cache when server memory is getting low).
  • 10. Custom Cache Provider... ● Output Caching are in memory. ● Functionality came with ASP.NET 4.0 ● Implements OutputCacheProvider. ● Add(), Get(), Set(), Remove() functions are available for operation ● Through custom cache provider cache could be stored in File system, Cloud, database, memory. ● Helpful under scavenging process (removing of cache when server memory is getting low). Cache Provider Add Get Set Remove DB Files
  • 11. Cache Provider Add Get Set Remove CloudDB Files Custom Cache Provider...
  • 12. Other techniques ● Profile Caching under web.config to be consistent with different setting. ● GlobalOutputCacheProviderName in Global.asax to change cache providers according to need. ● SQLCacheDependency has very limited support and also depends upon SQL configuration too. http://blogs.msdn.com/b/tolong/archive/2007/02/16/sql-cache-dependency.aspx http://www.codeproject.com/Articles/12335/Using-SqlDependency-for- data-change-events
  • 13. Caching Consideration ● Full page caching: If page contents changes after certain interval. ● Fragment caching: Some of page contents remains static but others are frequently changes. ● Object caching: Data is accessed frequently and takes time to load up. ● Cache dependency: File, Directory or based on other cache entries. ● Sliding or Absolute: Sliding, if data is not changed frequently.