SlideShare a Scribd company logo
1 of 26
HTTP Caching
Md. Rakib Trofder
Trainee Software Engineer
Cefalo Bangladesh Ltd.
Presented By
HTTP Caching
A technique that stores a copy of a frequently
accessed resource and serves it back when
requested.
Why Caching?
Reduce redundant data transfer
Reuse content
Increase application performance
Reduces the load on
the database.
What Can be Cached?
Cache-friendly Content Careful in Caching Content
What Can be Cached? (cont.)
Image files
Html files
Css files
Javascript files
When the data that is being requested
by an application is found in the cache
and data is still fresh.
When the data that is being requested by an
application isn’t found in the cache or data is not
fresh.
Cache Hit Cache Miss
Figure 1 : Processing a fresh cache hit
Client
Cache
Server
1. Receive HTTP
request message
2. Parse message 3. In cache?
4.Is fresh?
New headers Server headers
Body Body
5.Create
response
headers
6. Send Response
Figure 2 : Processing a cache miss
Client
Cache
Server
1. Receive HTTP request
message
2. Parse
message
3. In cache?
5. Send
Response
NEW headers
Body
4.Create
response
headers
Figure 3 : Processing a cache miss when cache is stale
Client
Cache
1. Receive HTTP
request message
2. Parse message
3. In cache?
4.Is fresh?
Server headers
Body
6. Send
Response
Server
NEW headers
Body
5.Create
response
headers
Types of caches in general view point
Private Cache Public Cache
Private Cache
A private cache is only used by one client, only for the IP it was created for.
User: rakib3004
Private Cache
Cached only for
User: rakib3004
Public Cache
Public cache is used by more than one client. Any public content that don’t need any
authentication or personalized info, that is stored in public cache
Client 1
Public
Cache
Client 2
Cached for both
Client 1 & Client 2
Some Common Approaches for Caching
Read Through
Cache Aside
Read Strategies
Write Back
Write Through
Write Strategies
Cache Aside
The application first checks the cache. If the data is not found in cache it queries the database to
read the data, returns it to the client and stores the data in cache.
Application
Cache
Database
Faster in read heavy applications
Data is not much frequently updated
Use TTL for remain consistent
between cache and database
Read Through
The application first checks the cache. If the data is not found in cache it queries the
database to read the data, populates the cache and returns it to the application.
Application Cache Database
Cache and database data always
remain consistent
Cache sits in-line with the
database.
The application treats cache as
the main data store
2. Cache Hit
Write Through
Data is first written to the cache and then to the database. The cache sits in-line with the
database and writes always go through the cache to the main database.
Cache maintains consistency
with the main database.
Implements in write heavy
applications
Application
Cache
Database
Heavy load on database due to
redundant write operation
1. {color: teal }
3.{color: dodger-blue}
5.{color: dark-turquoise}
7.{color: brown}
2. {color: teal }
4.{color: dodger-blue}
6.{color: dark-turquoise}
8.{color: brown}
Write Back
Here, the application writes data to the cache which stores the data and acknowledges to
the application immediately. A modified cache block is written back to the database, just
before it is replaced.
Reduces write operations in
write heavy applications
Asynchronous between cache
and database
Writes to the database with a
delay Application Cache Database
1. {color: teal }
3.{color: dodger-blue}
2.{color: dark-turquoise}
4.{color: brown}
5.{color: brown}
Some Caching Types in Web Development
Application Caching
Web Caching Data Caching
Distributed Caching
Web Caching is 2 types. They are: Browser Caching & Proxy Caching
Web Caching
Browser
Cache
Server
request
Response (content is
not cached or stale)
request
Response
(content is
cached and
fresh
Browser Caching helps individual users to quickly navigate pages they have recently visited.
A temporary storage area in memory or on disk
Instruct the user’s browser to cache certain files.
Web Caching (cont.)
Proxy Server
Cache
Server
Client
Proxy Caching allows cached information to be shared across larger groups of users.
Proxy Cache provides content to be delivered
to customers faster.
Proxy Cache data does not change frequently
Application Caching
Application caching cache database queries, HTML fragments, or the output of heavy
computations. It can drastically reduce your website load time and reduce server overhead.
Application
Cache
Database
Client
Decreased network costs
Access content without internet
Data Caching
It stores the data in local memory on the server and helps avoid extra trips to the database
for retrieving data that has not changed.
Client Data Cache Database
Reduces turnover time of database
queries
Implements in Database Driven Applications
Backup for any cache failure
Distributed Caching
Distributed cache is made up of a cluster of machines only serving up memory. Web servers
pull and store from distributed server’s memory.
Client Server
Distributed Cache
Used in high volume applications like
google, microsoft, amazon
Increase scalability
Application acceleration
1. caching-techniques-one-should-know
2. system-design-blog/what-is-caching-
3. four-major-caching-types-and-their-differences
4. choosing-between-public-cache-private-cache-and-esi
5. cache-aside-vs-read-through-cache
6. Web Caching
7. HTTP_cookie
8. first-party-cookies-vs-third-party-cookies/
9. how-to-prepare-for-the-cookieless-era
10. digging-into-the-privacy-sandbox
11. Federated_Learning_of_Cohorts
12. google-kills-off-floc-replaces-it-with-topics
13. turtledove-explained
14. privacy-sandbox/fledge
References
HTTP Caching.pptx

More Related Content

Similar to HTTP Caching.pptx

scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practiceswebuploader
 
A COMPARISON OF CACHE REPLACEMENT ALGORITHMS FOR VIDEO SERVICES
A COMPARISON OF CACHE REPLACEMENT ALGORITHMS FOR VIDEO SERVICESA COMPARISON OF CACHE REPLACEMENT ALGORITHMS FOR VIDEO SERVICES
A COMPARISON OF CACHE REPLACEMENT ALGORITHMS FOR VIDEO SERVICESijcsit
 
Basic Caching Terminology
Basic Caching TerminologyBasic Caching Terminology
Basic Caching TerminologyHTS Hosting
 
Sitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversSitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversAnindita Bhattacharya
 
How to boost performance of your rails app using dynamo db and memcached
How to boost performance of your rails app using dynamo db and memcachedHow to boost performance of your rails app using dynamo db and memcached
How to boost performance of your rails app using dynamo db and memcachedAndolasoft Inc
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Bhupesh Bansal
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop User Group
 
Implementing Advanced Caching and Replication Techniques in ...
Implementing Advanced Caching and Replication Techniques in ...Implementing Advanced Caching and Replication Techniques in ...
Implementing Advanced Caching and Replication Techniques in ...webhostingguy
 
BFC: High-Performance Distributed Big-File Cloud Storage Based On Key-Value S...
BFC: High-Performance Distributed Big-File Cloud Storage Based On Key-Value S...BFC: High-Performance Distributed Big-File Cloud Storage Based On Key-Value S...
BFC: High-Performance Distributed Big-File Cloud Storage Based On Key-Value S...dbpublications
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And ScalabilityJason Ragsdale
 
Best practices with Microsoft Graph: Making your applications more performant...
Best practices with Microsoft Graph: Making your applications more performant...Best practices with Microsoft Graph: Making your applications more performant...
Best practices with Microsoft Graph: Making your applications more performant...Microsoft Tech Community
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricWim Van den Broeck
 
Data Deduplication: Venti and its improvements
Data Deduplication: Venti and its improvementsData Deduplication: Venti and its improvements
Data Deduplication: Venti and its improvementsUmair Amjad
 
Redis as a Cache Boosting Performance and Scalability
Redis as a Cache Boosting Performance and ScalabilityRedis as a Cache Boosting Performance and Scalability
Redis as a Cache Boosting Performance and ScalabilityInexture Solutions
 
Introducing windows server_app_fabric
Introducing windows server_app_fabricIntroducing windows server_app_fabric
Introducing windows server_app_fabricMarco Titta
 
Academy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageAcademy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageBinary Studio
 
World Wide Web Caching
World Wide Web CachingWorld Wide Web Caching
World Wide Web Cachingersanbilik
 

Similar to HTTP Caching.pptx (20)

scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
 
A COMPARISON OF CACHE REPLACEMENT ALGORITHMS FOR VIDEO SERVICES
A COMPARISON OF CACHE REPLACEMENT ALGORITHMS FOR VIDEO SERVICESA COMPARISON OF CACHE REPLACEMENT ALGORITHMS FOR VIDEO SERVICES
A COMPARISON OF CACHE REPLACEMENT ALGORITHMS FOR VIDEO SERVICES
 
Performance engineering
Performance engineeringPerformance engineering
Performance engineering
 
Basic Caching Terminology
Basic Caching TerminologyBasic Caching Terminology
Basic Caching Terminology
 
Sitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversSitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN servers
 
How to boost performance of your rails app using dynamo db and memcached
How to boost performance of your rails app using dynamo db and memcachedHow to boost performance of your rails app using dynamo db and memcached
How to boost performance of your rails app using dynamo db and memcached
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
 
Implementing Advanced Caching and Replication Techniques in ...
Implementing Advanced Caching and Replication Techniques in ...Implementing Advanced Caching and Replication Techniques in ...
Implementing Advanced Caching and Replication Techniques in ...
 
BFC: High-Performance Distributed Big-File Cloud Storage Based On Key-Value S...
BFC: High-Performance Distributed Big-File Cloud Storage Based On Key-Value S...BFC: High-Performance Distributed Big-File Cloud Storage Based On Key-Value S...
BFC: High-Performance Distributed Big-File Cloud Storage Based On Key-Value S...
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
Best practices with Microsoft Graph: Making your applications more performant...
Best practices with Microsoft Graph: Making your applications more performant...Best practices with Microsoft Graph: Making your applications more performant...
Best practices with Microsoft Graph: Making your applications more performant...
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
 
Data Deduplication: Venti and its improvements
Data Deduplication: Venti and its improvementsData Deduplication: Venti and its improvements
Data Deduplication: Venti and its improvements
 
Redis as a Cache Boosting Performance and Scalability
Redis as a Cache Boosting Performance and ScalabilityRedis as a Cache Boosting Performance and Scalability
Redis as a Cache Boosting Performance and Scalability
 
Introducing windows server_app_fabric
Introducing windows server_app_fabricIntroducing windows server_app_fabric
Introducing windows server_app_fabric
 
Academy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageAcademy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storage
 
World Wide Web Caching
World Wide Web CachingWorld Wide Web Caching
World Wide Web Caching
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
Caching on the web
Caching on the webCaching on the web
Caching on the web
 

More from Md. Rakib Trofder

Software System Reconstruction using large language model
Software System Reconstruction using large language modelSoftware System Reconstruction using large language model
Software System Reconstruction using large language modelMd. Rakib Trofder
 
Daily Scrum, Sprint Review & Retrospective.pptx
Daily Scrum, Sprint Review & Retrospective.pptxDaily Scrum, Sprint Review & Retrospective.pptx
Daily Scrum, Sprint Review & Retrospective.pptxMd. Rakib Trofder
 
Scrum & Sprint Planning.pptx
Scrum & Sprint Planning.pptxScrum & Sprint Planning.pptx
Scrum & Sprint Planning.pptxMd. Rakib Trofder
 
Agricultural Business with Technology
Agricultural Business with TechnologyAgricultural Business with Technology
Agricultural Business with TechnologyMd. Rakib Trofder
 
Twitter Timeline and Search Distributed System.pptx
Twitter Timeline and Search Distributed System.pptxTwitter Timeline and Search Distributed System.pptx
Twitter Timeline and Search Distributed System.pptxMd. Rakib Trofder
 
Artificial Intelligence in Gaming.pptx
Artificial Intelligence in Gaming.pptxArtificial Intelligence in Gaming.pptx
Artificial Intelligence in Gaming.pptxMd. Rakib Trofder
 
Mechanism behind BlogBee Application
Mechanism behind BlogBee ApplicationMechanism behind BlogBee Application
Mechanism behind BlogBee ApplicationMd. Rakib Trofder
 
Massive Open Online Courses (MOOC)
Massive Open Online Courses (MOOC)Massive Open Online Courses (MOOC)
Massive Open Online Courses (MOOC)Md. Rakib Trofder
 
BlogBee A Blog Based Social Media.pptx
BlogBee A Blog Based Social Media.pptxBlogBee A Blog Based Social Media.pptx
BlogBee A Blog Based Social Media.pptxMd. Rakib Trofder
 
INTER-SYSTEMS EARNS ISO 9001-2008 CERTIFICATION
INTER-SYSTEMS EARNS ISO 9001-2008 CERTIFICATIONINTER-SYSTEMS EARNS ISO 9001-2008 CERTIFICATION
INTER-SYSTEMS EARNS ISO 9001-2008 CERTIFICATIONMd. Rakib Trofder
 
Web Technology Tag Presentation.pptx
Web Technology Tag Presentation.pptxWeb Technology Tag Presentation.pptx
Web Technology Tag Presentation.pptxMd. Rakib Trofder
 
Video to text blog (blog bee)
Video to text blog (blog bee)Video to text blog (blog bee)
Video to text blog (blog bee)Md. Rakib Trofder
 
Http status code 416 vs 428, 503 vs 505
Http status code  416 vs 428, 503 vs 505Http status code  416 vs 428, 503 vs 505
Http status code 416 vs 428, 503 vs 505Md. Rakib Trofder
 
Economy politics and city life
Economy politics and city lifeEconomy politics and city life
Economy politics and city lifeMd. Rakib Trofder
 

More from Md. Rakib Trofder (20)

Software System Reconstruction using large language model
Software System Reconstruction using large language modelSoftware System Reconstruction using large language model
Software System Reconstruction using large language model
 
Daily Scrum, Sprint Review & Retrospective.pptx
Daily Scrum, Sprint Review & Retrospective.pptxDaily Scrum, Sprint Review & Retrospective.pptx
Daily Scrum, Sprint Review & Retrospective.pptx
 
Scrum & Sprint Planning.pptx
Scrum & Sprint Planning.pptxScrum & Sprint Planning.pptx
Scrum & Sprint Planning.pptx
 
Agricultural Business with Technology
Agricultural Business with TechnologyAgricultural Business with Technology
Agricultural Business with Technology
 
Twitter Timeline and Search Distributed System.pptx
Twitter Timeline and Search Distributed System.pptxTwitter Timeline and Search Distributed System.pptx
Twitter Timeline and Search Distributed System.pptx
 
Artificial Intelligence in Gaming.pptx
Artificial Intelligence in Gaming.pptxArtificial Intelligence in Gaming.pptx
Artificial Intelligence in Gaming.pptx
 
Mechanism behind BlogBee Application
Mechanism behind BlogBee ApplicationMechanism behind BlogBee Application
Mechanism behind BlogBee Application
 
Massive Open Online Courses (MOOC)
Massive Open Online Courses (MOOC)Massive Open Online Courses (MOOC)
Massive Open Online Courses (MOOC)
 
Design Pattern.pptx
Design Pattern.pptxDesign Pattern.pptx
Design Pattern.pptx
 
BlogBee A Blog Based Social Media.pptx
BlogBee A Blog Based Social Media.pptxBlogBee A Blog Based Social Media.pptx
BlogBee A Blog Based Social Media.pptx
 
INTER-SYSTEMS EARNS ISO 9001-2008 CERTIFICATION
INTER-SYSTEMS EARNS ISO 9001-2008 CERTIFICATIONINTER-SYSTEMS EARNS ISO 9001-2008 CERTIFICATION
INTER-SYSTEMS EARNS ISO 9001-2008 CERTIFICATION
 
Web Technology Tag Presentation.pptx
Web Technology Tag Presentation.pptxWeb Technology Tag Presentation.pptx
Web Technology Tag Presentation.pptx
 
Video to text blog (blog bee)
Video to text blog (blog bee)Video to text blog (blog bee)
Video to text blog (blog bee)
 
Web tech tag explanation
Web tech tag explanationWeb tech tag explanation
Web tech tag explanation
 
Library assistant tool
Library assistant toolLibrary assistant tool
Library assistant tool
 
Http status code 416 vs 428, 503 vs 505
Http status code  416 vs 428, 503 vs 505Http status code  416 vs 428, 503 vs 505
Http status code 416 vs 428, 503 vs 505
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Page rank algorithm
Page rank algorithmPage rank algorithm
Page rank algorithm
 
Analytic hierarchy process
Analytic hierarchy processAnalytic hierarchy process
Analytic hierarchy process
 
Economy politics and city life
Economy politics and city lifeEconomy politics and city life
Economy politics and city life
 

Recently uploaded

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 

Recently uploaded (20)

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

HTTP Caching.pptx

  • 2. Md. Rakib Trofder Trainee Software Engineer Cefalo Bangladesh Ltd. Presented By
  • 3. HTTP Caching A technique that stores a copy of a frequently accessed resource and serves it back when requested.
  • 4. Why Caching? Reduce redundant data transfer Reuse content Increase application performance Reduces the load on the database.
  • 5. What Can be Cached? Cache-friendly Content Careful in Caching Content
  • 6. What Can be Cached? (cont.) Image files Html files Css files Javascript files
  • 7. When the data that is being requested by an application is found in the cache and data is still fresh. When the data that is being requested by an application isn’t found in the cache or data is not fresh. Cache Hit Cache Miss
  • 8. Figure 1 : Processing a fresh cache hit Client Cache Server 1. Receive HTTP request message 2. Parse message 3. In cache? 4.Is fresh? New headers Server headers Body Body 5.Create response headers 6. Send Response
  • 9. Figure 2 : Processing a cache miss Client Cache Server 1. Receive HTTP request message 2. Parse message 3. In cache? 5. Send Response NEW headers Body 4.Create response headers
  • 10. Figure 3 : Processing a cache miss when cache is stale Client Cache 1. Receive HTTP request message 2. Parse message 3. In cache? 4.Is fresh? Server headers Body 6. Send Response Server NEW headers Body 5.Create response headers
  • 11. Types of caches in general view point Private Cache Public Cache
  • 12. Private Cache A private cache is only used by one client, only for the IP it was created for. User: rakib3004 Private Cache Cached only for User: rakib3004
  • 13. Public Cache Public cache is used by more than one client. Any public content that don’t need any authentication or personalized info, that is stored in public cache Client 1 Public Cache Client 2 Cached for both Client 1 & Client 2
  • 14. Some Common Approaches for Caching Read Through Cache Aside Read Strategies Write Back Write Through Write Strategies
  • 15. Cache Aside The application first checks the cache. If the data is not found in cache it queries the database to read the data, returns it to the client and stores the data in cache. Application Cache Database Faster in read heavy applications Data is not much frequently updated Use TTL for remain consistent between cache and database
  • 16. Read Through The application first checks the cache. If the data is not found in cache it queries the database to read the data, populates the cache and returns it to the application. Application Cache Database Cache and database data always remain consistent Cache sits in-line with the database. The application treats cache as the main data store 2. Cache Hit
  • 17. Write Through Data is first written to the cache and then to the database. The cache sits in-line with the database and writes always go through the cache to the main database. Cache maintains consistency with the main database. Implements in write heavy applications Application Cache Database Heavy load on database due to redundant write operation 1. {color: teal } 3.{color: dodger-blue} 5.{color: dark-turquoise} 7.{color: brown} 2. {color: teal } 4.{color: dodger-blue} 6.{color: dark-turquoise} 8.{color: brown}
  • 18. Write Back Here, the application writes data to the cache which stores the data and acknowledges to the application immediately. A modified cache block is written back to the database, just before it is replaced. Reduces write operations in write heavy applications Asynchronous between cache and database Writes to the database with a delay Application Cache Database 1. {color: teal } 3.{color: dodger-blue} 2.{color: dark-turquoise} 4.{color: brown} 5.{color: brown}
  • 19. Some Caching Types in Web Development Application Caching Web Caching Data Caching Distributed Caching
  • 20. Web Caching is 2 types. They are: Browser Caching & Proxy Caching Web Caching Browser Cache Server request Response (content is not cached or stale) request Response (content is cached and fresh Browser Caching helps individual users to quickly navigate pages they have recently visited. A temporary storage area in memory or on disk Instruct the user’s browser to cache certain files.
  • 21. Web Caching (cont.) Proxy Server Cache Server Client Proxy Caching allows cached information to be shared across larger groups of users. Proxy Cache provides content to be delivered to customers faster. Proxy Cache data does not change frequently
  • 22. Application Caching Application caching cache database queries, HTML fragments, or the output of heavy computations. It can drastically reduce your website load time and reduce server overhead. Application Cache Database Client Decreased network costs Access content without internet
  • 23. Data Caching It stores the data in local memory on the server and helps avoid extra trips to the database for retrieving data that has not changed. Client Data Cache Database Reduces turnover time of database queries Implements in Database Driven Applications Backup for any cache failure
  • 24. Distributed Caching Distributed cache is made up of a cluster of machines only serving up memory. Web servers pull and store from distributed server’s memory. Client Server Distributed Cache Used in high volume applications like google, microsoft, amazon Increase scalability Application acceleration
  • 25. 1. caching-techniques-one-should-know 2. system-design-blog/what-is-caching- 3. four-major-caching-types-and-their-differences 4. choosing-between-public-cache-private-cache-and-esi 5. cache-aside-vs-read-through-cache 6. Web Caching 7. HTTP_cookie 8. first-party-cookies-vs-third-party-cookies/ 9. how-to-prepare-for-the-cookieless-era 10. digging-into-the-privacy-sandbox 11. Federated_Learning_of_Cohorts 12. google-kills-off-floc-replaces-it-with-topics 13. turtledove-explained 14. privacy-sandbox/fledge References

Editor's Notes

  1. Md. Rakib Trofder: https://bd.linkedin.com/in/rakib-iit Tasmia Zerin: https://bd.linkedin.com/in/tasmia-zerin-81aa4b18a
  2. “A technique that stores a copy of a frequently accessed resource and serves it back when requested” Definition: https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies
  3. Advantages of Caching : https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies
  4. What Can be Cached? : https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies Logos and brand images, Style sheets , General Javascript files, Media Files, —--------------------------- HTML pages, Frequently modified Javascript and CSS, Content requested with authentication cookie
  5. What Can be Cached? : https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies Cache URL link: https://mail.google.com/mail/u/0/
  6. Cache Hit: When the data that is being requested by an application is found in the cache and data is still fresh. Cache Miss: When the data that is being requested by an application isn’t found in the cache or data is not fresh.
  7. Processing a fresh cache hit: https://www.oreilly.com/library/view/http-the-definitive/1565925092/ch07s07.html Code Snippets from: https://carbon.now.sh/ Request Message Response Message
  8. Processing a fresh cache hit: https://www.oreilly.com/library/view/http-the-definitive/1565925092/ch07s07.html Cache Processing Steps: Receiving—Cache reads the arriving request message from the network. Parsing—Cache parses the message, extracting the URL and headers. Lookup—Cache checks if a local copy is available and, if not, fetches a copy (and stores it locally). Freshness check—Cache checks if cached copy is fresh enough and, if not, asks server for any updates. Response creation—Cache makes a response message with the new headers and cached body. Sending—Cache sends the response back to the client over the network. Logging—Optionally, cache creates a log file entry describing the transaction.
  9. Processing a fresh cache hit: https://www.oreilly.com/library/view/http-the-definitive/1565925092/ch07s07.html Code Snippets from: https://carbon.now.sh/ Request Message Response Message
  10. Caching Types: https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching https://stackoverflow.com/questions/3492319/private-vs-public-in-cache-control https://software-factotum.medium.com/effective-http-caching-part-iii-public-private-and-no-store-b64f0452325#:~:text=The%20%E2%80%9Cpublic%E2%80%9D%20response%20directive%20indicates,stored%20by%20a%20shared%20cache.
  11. Generally this applies only to a cache maintained by that client itself, though if you had a proxy that was only being used by one client it would be possible to configure it to act as a private cache. Example: Github Own Profile Private: Default value. Sets Cache-Control: private to specify that the response is cacheable only on the client and not by shared (proxy server) caches. Private Cache: The first link on the home page takes user to another page which is also uploaded to same S3 bucket but additionally has metadata configured
  12. A public, or “shared” cache is used by more than one client. As such, it gives a greater performance gain and a much greater scalability gain, as a user may receive cached copies of representations without ever having obtained a copy directly from the origin server. Public Cache : From the response header captured in Chrome, notice that the browser serves page from Cache after first access. Multiple refresh of this page would return 304 Not Modified https://software-factotum.medium.com/effective-http-caching-part-iii-public-private-and-no-store-b64f0452325#:~:text=The%20%E2%80%9Cpublic%E2%80%9D%20response%20directive%20indicates,stored%20by%20a%20shared%20cache. Example of public cache: Squid Akamai Croxy Proxy Varnish Cache
  13. https://dev.to/tharindu/a-quick-introduction-to-distributed-caching-48e3 https://medium.com/system-design-blog/what-is-caching-1492abb92143 https://www.prisma.io/dataguide/managing-databases/introduction-database-caching Read Strategies and Write Strategies naam e alada korte hobe
  14. In memory cache, fast. No direct connection between cache and database TTL:Expire key, when it expires, then the key is not found. The database is queried for the key and update the cache. Best suits for: Read-heavy workloads Data that is not much frequently updated: https://medium.com/bliblidotcom-techblog/redis-cache-aside-pattern-72fff2e4f927 Auto Refresh in cache aside alachisoft
  15. Read Through and Write Through work together, The application treats cache as the main data store: https://www.alachisoft.com/resources/articles/readthru-writethru-writebehind.html#:~:text=Read%2Dthrough%2FWrite%2Dthrough,the%20application%20of%20this%20responsibility Cache sits in-line with the database: Read Through Prisma Blog Cache and database data always remain consistent: https://dev.to/tharindu/a-quick-introduction-to-distributed-caching-48e3 It is common for developers to mitigate this delay by ‘warming’ the cache by issuing likely to happen queries manually. Cache sits in-line with the database. When there is a cache miss, it loads missing data from the database, populates the cache and returns it to the application. Cache always stays consistent with the database. Best suits for: Read-heavy workloads. Read through and write through cache can see in a same application. Auto Refresh in read through alachisoft
  16. Data is first written to the cache and then to the database. The cache sits in-line with the database and writes always go through the cache to the main database. Maintains high consistency between the cache and the database (but, adds a little latency during the write operations as data is to be updated in the cache additionally.) Best suits for: write-heavy workloads like online multiplayer games Reference: https://dev.to/tharindu/a-quick-introduction-to-distributed-caching-48e3 https://www.prisma.io/dataguide/managing-databases/introduction-database-caching
  17. Write Back Reference: https://dev.to/tharindu/a-quick-introduction-to-distributed-caching-48e3 In write through, more load on database so we use write back to reduce server load. Application writes data to the cache which acknowledges immediately and after some delay, it writes the data back to the database. Asynchronous between cache and database
  18. Some Caching Types in Web Development main reference: https://bootcamp.uxdesign.cc/caching-techniques-one-should-know-603e09d2b298
  19. A browser or Web cache does exactly that, except with program and website assets. When you visit a website, your browser takes pieces of the page and stores them on your computer's hard drive. Some of the assets your browser will store are: Images - logos, pictures, backgrounds, etc. HTML CSS JavaScript In short, browsers typically cache what are known as "static assets" - parts of a website that do not change from visit to visit. Link: https://www.bigcommerce.com/ecommerce-answers/what-browser-cache-and-why-it-important/
  20. Cache Provide: https://docs.servicestack.net/caching Proxy Cache provides content to be delivered to customers faster. https://www.stackpath.com/edge-academy/what-is-proxy-caching/#:~:text=Proxy%20caching%20is%20a%20feature,files%2C%20images%20and%20web%20pages. Proxy Cache data does not change frequently:https://bootcamp.uxdesign.cc/caching-techniques-one-should-know-603e09d2b298
  21. Utilizes server-level caching techniques: https://www.ironistic.com/insights/four-major-caching-types-and-their-differences/ Access content without internet: https://bootcamp.uxdesign.cc/caching-techniques-one-should-know-603e09d2b298 Decreased network costs: https://www.ironistic.com/insights/four-major-caching-types-and-their-differences/
  22. Implements in Database Driven Applications: https://bootcamp.uxdesign.cc/caching-techniques-one-should-know-603e09d2b298 Reduces turnover time of database queries: https://bootcamp.uxdesign.cc/caching-techniques-one-should-know-603e09d2b298 Backup for any cache failure: https://www.ironistic.com/insights/four-major-caching-types-and-their-differences/ It stores the data in local memory on the server which is the fastest way to retrieve information on a web server: https://www.ironistic.com/insights/four-major-caching-types-and-their-differences/
  23. Used in high volume applications like google, microsoft, amazon : https://bootcamp.uxdesign.cc/caching-techniques-one-should-know-603e09d2b298 Increase scalability: https://www.ironistic.com/insights/four-major-caching-types-and-their-differences/ Application acceleration : https://www.linkedin.com/pulse/application-caching-strategies-konstantinos-kalafatis-1f?trk=pulse-article_more-articles_related-content-card Application acceleration: Most applications rely on disk-based databases, either directly or indirectly, and can't always meet today's increasingly demanding requirements. By caching the most frequently accessed data in a distributed cache, we can dramatically reduce the bottleneck of disk-based systems.
  24. https://softwarelab.org/what-is-a-cache/ https://dev.to/tharindu/a-quick-introduction-to-distributed-caching-48e3