Catching in C#
Presented by:
Bhumika
Kaushal Agarwal
Presented to:
Prof. Madhuraj Narwaria
Content:
• Introduction
• What a Cache does
• Types of Catching
Introduction:
• Caching is a technique of storing frequently used
data/information in memory, so that, when the same
data/information is needed next time, it could be
directly retrieved from the memory instead of being
generated by the application.
• Caching places frequently used data in quickly accessed media such as the
random access memory of the computer. The ASP.NET runtime includes a
key-value map of CLR objects called cache. This resides with the application and
is available via the HttpContext and System.Web.UI.Page.
• The data will not be available in the following cases:
• If its lifetime expires
• If the application releases its memory
• If caching does not take place for some reason
You can access items in the cache using an indexer and may control the lifetime
of objects in the cache and set up links between the cached objects and their
physical sources.
Continue:
What a Cache does
• A cache simply stores the output
generated by a page in the
memory and this saved output (cache)
will serve us (users) in the future.
Types of Catching
Page Caching
• When we compile our code it is first it compiled into Microsoft Int
ermediate Language (MSIL) then The MSIL is converted into Native
Code using the JIT Compiler. Now if there is a page that changes fr
equently then the JIT needs to compile it every time. So, rather tha
n generate a page on each request we can cache the page using Pa
ge Output Caching so that it can be accessed from the cache itself.
< %@OutputCache Duration= "60" VaryByParam= "DepartmentI
d"% >
All the attributes that we specify in an OutputCache directive are u
sed to populate an instance of the System.Web.HttpCachePolicy cl
ass. Moreover, It is good if the website is fairly static.
Page Fragment Caching
• ASP.NET provides a mechanism for caching portions of pages,
called page fragment caching . For example: user control. To ca
che a portion of a page, you must first encapsulate the portion
of the page you want to cache into a user control . In the user
control source file, add an OutputCache directive specifying the
Duration and VaryByParam attributes. When that user control is
loaded into a page at runtime , it is cached, and all subsequent
pages that reference that same user control will retrieve it from
the cache.
Data Caching
• Data Caching is used to fetch the information of an application quickly based o
n the requirements. Cache object is just like application object which can be acc
ess anywhere in the application. The lifetime of the cache is equivalent to the lif
etime of the application. Caching data can dramatically improve the performance
of an application by reducing database contention and round-trips .
THANK YOU

More Related Content

DOCX
Caching in asp.net
DOCX
Caching in asp.net
PPTX
Asp.net
PPT
salkdjfhdjkghdfkjh
PPT
aksdfhaskdjfhasdjkh
PPT
askldjfhaskdfj aslkdjfhaskdfhasjk askldf ashkdf
PPT
sergaerwga
PPT
awergaezrg
Caching in asp.net
Caching in asp.net
Asp.net
salkdjfhdjkghdfkjh
aksdfhaskdjfhasdjkh
askldjfhaskdfj aslkdjfhaskdfhasjk askldf ashkdf
sergaerwga
awergaezrg

Similar to catching in c#.pptx (20)

PPT
sakdjfhaksjfhaskjh
PPT
aergserga
PPT
Aspnet Caching
PPTX
PDF
Asp.net caching
PPTX
ASP.NET 4.0 Cache Extensibility
PPTX
Dotnet caching techniques
PDF
ASP.NET Scalability - WebDD
PPTX
.Net Distributed Caching
PPTX
Caching in asp.net mvc
PPTX
Caching Enhancement in ASP.NET 4.0
PDF
ASP.NET Scalability - VBUG London
PPTX
Mini-Training: To cache or not to cache
PDF
ASP.NET Scalability - DDD7
PPT
2310 b 15
PPT
2310 b 15
PPSX
13 asp.net session19
PDF
ASP.NET Scalability - NxtGen Oxford
PPTX
ASP.NET Best Practices - Useful Tips from the Trenches
sakdjfhaksjfhaskjh
aergserga
Aspnet Caching
Asp.net caching
ASP.NET 4.0 Cache Extensibility
Dotnet caching techniques
ASP.NET Scalability - WebDD
.Net Distributed Caching
Caching in asp.net mvc
Caching Enhancement in ASP.NET 4.0
ASP.NET Scalability - VBUG London
Mini-Training: To cache or not to cache
ASP.NET Scalability - DDD7
2310 b 15
2310 b 15
13 asp.net session19
ASP.NET Scalability - NxtGen Oxford
ASP.NET Best Practices - Useful Tips from the Trenches
Ad

Recently uploaded (20)

PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
Hazard Identification & Risk Assessment .pdf
PPTX
20th Century Theater, Methods, History.pptx
PDF
Trump Administration's workforce development strategy
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
advance database management system book.pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
IGGE1 Understanding the Self1234567891011
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
International_Financial_Reporting_Standa.pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PPTX
Virtual and Augmented Reality in Current Scenario
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
Weekly quiz Compilation Jan -July 25.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Practical Manual AGRO-233 Principles and Practices of Natural Farming
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Share_Module_2_Power_conflict_and_negotiation.pptx
Hazard Identification & Risk Assessment .pdf
20th Century Theater, Methods, History.pptx
Trump Administration's workforce development strategy
AI-driven educational solutions for real-life interventions in the Philippine...
advance database management system book.pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
IGGE1 Understanding the Self1234567891011
B.Sc. DS Unit 2 Software Engineering.pptx
LDMMIA Reiki Yoga Finals Review Spring Summer
International_Financial_Reporting_Standa.pdf
FORM 1 BIOLOGY MIND MAPS and their schemes
Virtual and Augmented Reality in Current Scenario
Ad

catching in c#.pptx

  • 1. Catching in C# Presented by: Bhumika Kaushal Agarwal Presented to: Prof. Madhuraj Narwaria
  • 2. Content: • Introduction • What a Cache does • Types of Catching
  • 3. Introduction: • Caching is a technique of storing frequently used data/information in memory, so that, when the same data/information is needed next time, it could be directly retrieved from the memory instead of being generated by the application.
  • 4. • Caching places frequently used data in quickly accessed media such as the random access memory of the computer. The ASP.NET runtime includes a key-value map of CLR objects called cache. This resides with the application and is available via the HttpContext and System.Web.UI.Page. • The data will not be available in the following cases: • If its lifetime expires • If the application releases its memory • If caching does not take place for some reason You can access items in the cache using an indexer and may control the lifetime of objects in the cache and set up links between the cached objects and their physical sources. Continue:
  • 5. What a Cache does • A cache simply stores the output generated by a page in the memory and this saved output (cache) will serve us (users) in the future.
  • 7. Page Caching • When we compile our code it is first it compiled into Microsoft Int ermediate Language (MSIL) then The MSIL is converted into Native Code using the JIT Compiler. Now if there is a page that changes fr equently then the JIT needs to compile it every time. So, rather tha n generate a page on each request we can cache the page using Pa ge Output Caching so that it can be accessed from the cache itself. < %@OutputCache Duration= "60" VaryByParam= "DepartmentI d"% > All the attributes that we specify in an OutputCache directive are u sed to populate an instance of the System.Web.HttpCachePolicy cl ass. Moreover, It is good if the website is fairly static.
  • 8. Page Fragment Caching • ASP.NET provides a mechanism for caching portions of pages, called page fragment caching . For example: user control. To ca che a portion of a page, you must first encapsulate the portion of the page you want to cache into a user control . In the user control source file, add an OutputCache directive specifying the Duration and VaryByParam attributes. When that user control is loaded into a page at runtime , it is cached, and all subsequent pages that reference that same user control will retrieve it from the cache.
  • 9. Data Caching • Data Caching is used to fetch the information of an application quickly based o n the requirements. Cache object is just like application object which can be acc ess anywhere in the application. The lifetime of the cache is equivalent to the lif etime of the application. Caching data can dramatically improve the performance of an application by reducing database contention and round-trips .