SlideShare a Scribd company logo
Drupal Day 2020 – Drupal
Cache Systems and Varnish
Pedro Dias
November 2020
2
Drupal cache out
of the box
Internal Dynamic Page CacheInternal Page Caching
3
Every request constructs the output Saves the whole HTML for a given page,
useful for a website with anonymous
visitors
Caches page components instead of the
whole page, avoids a component to be
computed in every requests if it behaves
the same for all the pages
Cache turned off
Drupal out of the box caching systems
4
Drupal out of the box caching systems
What is cacheable in
Drupal?
—Every renderable element
Cache Max-ageCache Contexts
5
• A way of tagging a cacheable element
used for bulk invalidation.
• Used to create cache related elements
• When a cache tag is invalidated, all
elements with that tag are invalidated
• Appliable to all renderable elements
• Custom ones can be created
• Provides a way of storing cache
contextualized with the incoming
request
• Analogous to HTTP's Vary header.
• Provides the ability for different users
to see different cached content
• Appliable to all renderable elements
• Custom ones can be created
• Instructs the time to live of the
renderable element cache
Cacheability Metadata in Drupal
Cache Tags
6
Cacheability Metadata in Drupal
7
Enhance Drupal
with Varnish
Enhance Drupal with Varnish
8
What is Varnish?
- HTTP Accelerator known as HTTP Reverse
Proxy
- Stores the generated HTML for a given URL
and serves the request without hitting the
webserver
- Speeds up delivery with a factor of 300 -
1000x
Enhance Drupal with Varnish
9
Drupal and Varnish
- Installing Drupal Varnish Cache Contrib
module give the ability to integrate with
Cache Tags.
- Drupal + Varnish out-of-the-box work like
Drupal Internal Page Cache
- Same cache for every visitors
Icons made by Freepick from www.flaticon.com
Enhance Drupal with Varnish
10
Having Drupal + Varnish Installed
Contextual response example
• Our users have a attribute called “Has car”
• We want to deliver different content to the user based on this
attribute
• Cache contexts won’t work
Enhance Drupal with Varnish
11
Means that we cannot serve content
based on the request context?
• Out of the box no, Varnish caches pages based on the URL
• Varnish offers a Vary mechanism to make cache be contextual for
the request (Same logic as Drupal Cache-Contexts)
• Varnish can be instructed by webserver response how the cache
varies using the response Vary header
• Vary header should contain which request headers should be
used to store the cache based on their combinations
• For our example we need to add the request header that contains
the attribute value to make it vary
Enhance Drupal with Varnish – Initial state
12
Icons made by Freepick from www.flaticon.com
Enhance Drupal with Varnish – Adding the CDN
13
Icons made by Freepick from www.flaticon.com
Enhance Drupal with Varnish – Make Info about car available on client-side
14
Icons made by Freepick from www.flaticon.com
Enhance Drupal with Varnish – Add the cookie value as a Request header by CDN
15
Icons made by Freepick from www.flaticon.com
Enhance Drupal with Varnish – Make cache Vary by X-Has-Car header
16
Icons made by Freepick from www.flaticon.com
Enhance Drupal with Varnish - Summary
17
Summary
• Value needed for cache to Vary passed to client side using a
cookie
• Leverage the use of a CDN to transform a cookie into a Request
Header
• Drupal instructs Varnish to Vary cache based on that header
Icons made by Freepick from www.flaticon.com
Enhance Drupal with Varnish – Combine with Cache contexts
18
Combine Varnish and Drupal cache
• Cache contexts continue to make sense in reusable components
• Enhances performance on shared components
• Pages in which the content is different from the path should use
the before explained mechanism
Enhance Drupal with Varnish
19
Tips to handle cache problems
• Remember that the first hit is always cached
• Setup http.response.debug_cacheability_headers in services.yml
and check X-Drupal-Cache-Contexts
• For debugging Varnish you can pass all the request headers
started to X to the response
20
Thank you!

More Related Content

What's hot

IWMW 1997: WWW Caching
IWMW 1997: WWW CachingIWMW 1997: WWW Caching
IWMW 1997: WWW Caching
IWMW
 
RESTful Web services in Drupal 8
RESTful Web services in Drupal 8RESTful Web services in Drupal 8
RESTful Web services in Drupal 8
valuebound
 
IWMW 1997: Database-WWW Integration
IWMW 1997: Database-WWW IntegrationIWMW 1997: Database-WWW Integration
IWMW 1997: Database-WWW Integration
IWMW
 
Scaling wordpress for high traffic
Scaling wordpress for high trafficScaling wordpress for high traffic
Scaling wordpress for high traffic
Roshan Bhattarai
 
Roshan Bhattarai: Scaling WordPress for high traffic sites
Roshan Bhattarai: Scaling WordPress for high traffic sitesRoshan Bhattarai: Scaling WordPress for high traffic sites
Roshan Bhattarai: Scaling WordPress for high traffic sites
wpnepal
 
Ch08
Ch08Ch08
Redis e Memcached - Daniel Naves - Omnilogic
Redis e Memcached - Daniel Naves - OmnilogicRedis e Memcached - Daniel Naves - Omnilogic
Redis e Memcached - Daniel Naves - Omnilogic
Felipe Guimarães
 
Comparison of Drupal and WordPress
Comparison of Drupal and WordPressComparison of Drupal and WordPress
Comparison of Drupal and WordPress
Stern Data Solutions
 
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part20812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
Raul Chong
 
Site building using Drupal 8
Site building using Drupal 8Site building using Drupal 8
Site building using Drupal 8
UniMitySolution
 
WordPress: Performance, Optimization & Scaling
WordPress: Performance, Optimization & ScalingWordPress: Performance, Optimization & Scaling
WordPress: Performance, Optimization & Scaling
Pete Mall
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
drupalcampest
 
Dynamic Website
Dynamic Website Dynamic Website
Dynamic Website
OGEN Infosystem
 
Sitebuildingdrupal 8
Sitebuildingdrupal 8Sitebuildingdrupal 8
Sitebuildingdrupal 8
UniMity Solutions
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
Chapter Three
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
Tuyển Đoàn
 
Dynamic Website Designing
Dynamic Website DesigningDynamic Website Designing
Dynamic Website Designing
OGEN Infosystem
 
Optimize drupal
Optimize drupalOptimize drupal
Optimize drupal
Le Thanh Sang
 
Front End development of biological database
Front End development of biological databaseFront End development of biological database
Front End development of biological database
Vishaal Baruah
 

What's hot (19)

IWMW 1997: WWW Caching
IWMW 1997: WWW CachingIWMW 1997: WWW Caching
IWMW 1997: WWW Caching
 
RESTful Web services in Drupal 8
RESTful Web services in Drupal 8RESTful Web services in Drupal 8
RESTful Web services in Drupal 8
 
IWMW 1997: Database-WWW Integration
IWMW 1997: Database-WWW IntegrationIWMW 1997: Database-WWW Integration
IWMW 1997: Database-WWW Integration
 
Scaling wordpress for high traffic
Scaling wordpress for high trafficScaling wordpress for high traffic
Scaling wordpress for high traffic
 
Roshan Bhattarai: Scaling WordPress for high traffic sites
Roshan Bhattarai: Scaling WordPress for high traffic sitesRoshan Bhattarai: Scaling WordPress for high traffic sites
Roshan Bhattarai: Scaling WordPress for high traffic sites
 
Ch08
Ch08Ch08
Ch08
 
Redis e Memcached - Daniel Naves - Omnilogic
Redis e Memcached - Daniel Naves - OmnilogicRedis e Memcached - Daniel Naves - Omnilogic
Redis e Memcached - Daniel Naves - Omnilogic
 
Comparison of Drupal and WordPress
Comparison of Drupal and WordPressComparison of Drupal and WordPress
Comparison of Drupal and WordPress
 
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part20812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
 
Site building using Drupal 8
Site building using Drupal 8Site building using Drupal 8
Site building using Drupal 8
 
WordPress: Performance, Optimization & Scaling
WordPress: Performance, Optimization & ScalingWordPress: Performance, Optimization & Scaling
WordPress: Performance, Optimization & Scaling
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
 
Dynamic Website
Dynamic Website Dynamic Website
Dynamic Website
 
Sitebuildingdrupal 8
Sitebuildingdrupal 8Sitebuildingdrupal 8
Sitebuildingdrupal 8
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
 
Dynamic Website Designing
Dynamic Website DesigningDynamic Website Designing
Dynamic Website Designing
 
Optimize drupal
Optimize drupalOptimize drupal
Optimize drupal
 
Front End development of biological database
Front End development of biological databaseFront End development of biological database
Front End development of biological database
 

Similar to DRUPAL CACHE SYSTEMS AND VARNISH

Tips To Increase The Speed Of Drupal 8 Websites
Tips To Increase The Speed Of Drupal 8 WebsitesTips To Increase The Speed Of Drupal 8 Websites
Tips To Increase The Speed Of Drupal 8 Websites
InternetDevels
 
Advanced Drupal 8 Caching
Advanced Drupal 8 CachingAdvanced Drupal 8 Caching
Advanced Drupal 8 Caching
David Timothy Strauss
 
Varnish intro
Varnish introVarnish intro
Varnish intro
Boyan Borisov
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
Ratnesh kumar, CSM
 
Decoupling Drupal - Drupal Camp Toronto 2014
Decoupling Drupal - Drupal Camp Toronto 2014Decoupling Drupal - Drupal Camp Toronto 2014
Decoupling Drupal - Drupal Camp Toronto 2014
Alex De Winne
 
Html Optimization for SEO
Html Optimization for SEOHtml Optimization for SEO
Html Optimization for SEO
S. Ernest Paul ✪
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
Promet Source
 
Building faster websites: web performance with WordPress
Building faster websites: web performance with WordPressBuilding faster websites: web performance with WordPress
Building faster websites: web performance with WordPress
Johannes Siipola
 
In-Fisherman.com - Building an Enterprise Level Drupal Site
In-Fisherman.com - Building an Enterprise Level Drupal SiteIn-Fisherman.com - Building an Enterprise Level Drupal Site
In-Fisherman.com - Building an Enterprise Level Drupal Site
Mediacurrent
 
Drupal 8 and NGINX
Drupal 8 and NGINX Drupal 8 and NGINX
Drupal 8 and NGINX
NGINX, Inc.
 
PHP Performance tuning for Drupal 8
PHP Performance tuning for Drupal 8PHP Performance tuning for Drupal 8
PHP Performance tuning for Drupal 8
Acquia
 
Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website
Phase2
 
Contentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshopContentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshop
Ivo Lukac
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
Twinbit
 
Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)
Timur Kamanin
 
The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010
Phil Pursglove
 
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
IrishDev.com
 
Showcasing drupal
Showcasing drupalShowcasing drupal
Showcasing drupal
Opevel
 
Case study - Nuskin: Statefull Applications in a Stateless World
Case study - Nuskin: Statefull Applications in a Stateless WorldCase study - Nuskin: Statefull Applications in a Stateless World
Case study - Nuskin: Statefull Applications in a Stateless World
Day Software
 
Ror caching
Ror cachingRor caching
Ror caching
Kashyap Parmar
 

Similar to DRUPAL CACHE SYSTEMS AND VARNISH (20)

Tips To Increase The Speed Of Drupal 8 Websites
Tips To Increase The Speed Of Drupal 8 WebsitesTips To Increase The Speed Of Drupal 8 Websites
Tips To Increase The Speed Of Drupal 8 Websites
 
Advanced Drupal 8 Caching
Advanced Drupal 8 CachingAdvanced Drupal 8 Caching
Advanced Drupal 8 Caching
 
Varnish intro
Varnish introVarnish intro
Varnish intro
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
 
Decoupling Drupal - Drupal Camp Toronto 2014
Decoupling Drupal - Drupal Camp Toronto 2014Decoupling Drupal - Drupal Camp Toronto 2014
Decoupling Drupal - Drupal Camp Toronto 2014
 
Html Optimization for SEO
Html Optimization for SEOHtml Optimization for SEO
Html Optimization for SEO
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
Building faster websites: web performance with WordPress
Building faster websites: web performance with WordPressBuilding faster websites: web performance with WordPress
Building faster websites: web performance with WordPress
 
In-Fisherman.com - Building an Enterprise Level Drupal Site
In-Fisherman.com - Building an Enterprise Level Drupal SiteIn-Fisherman.com - Building an Enterprise Level Drupal Site
In-Fisherman.com - Building an Enterprise Level Drupal Site
 
Drupal 8 and NGINX
Drupal 8 and NGINX Drupal 8 and NGINX
Drupal 8 and NGINX
 
PHP Performance tuning for Drupal 8
PHP Performance tuning for Drupal 8PHP Performance tuning for Drupal 8
PHP Performance tuning for Drupal 8
 
Drupal is not your Website
Drupal is not your Website Drupal is not your Website
Drupal is not your Website
 
Contentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshopContentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshop
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
 
Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)
 
The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010The Need for Speed - EpiCenter 2010
The Need for Speed - EpiCenter 2010
 
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
 
Showcasing drupal
Showcasing drupalShowcasing drupal
Showcasing drupal
 
Case study - Nuskin: Statefull Applications in a Stateless World
Case study - Nuskin: Statefull Applications in a Stateless WorldCase study - Nuskin: Statefull Applications in a Stateless World
Case study - Nuskin: Statefull Applications in a Stateless World
 
Ror caching
Ror cachingRor caching
Ror caching
 

More from Drupal Portugal

DRUPAL DIGITAL MARKETING CHECKLIST
DRUPAL DIGITAL MARKETING CHECKLISTDRUPAL DIGITAL MARKETING CHECKLIST
DRUPAL DIGITAL MARKETING CHECKLIST
Drupal Portugal
 
Drupal Day Portugal 2020 - Closing Remarks / Encerramento
Drupal Day Portugal 2020 - Closing Remarks / EncerramentoDrupal Day Portugal 2020 - Closing Remarks / Encerramento
Drupal Day Portugal 2020 - Closing Remarks / Encerramento
Drupal Portugal
 
BRANCHING MODELS (workshop)
BRANCHING MODELS (workshop)BRANCHING MODELS (workshop)
BRANCHING MODELS (workshop)
Drupal Portugal
 
TURN YOUR DRUPAL INTO A DIGITAL EXPERIENCE PLATFORM (DXP)
TURN YOUR DRUPAL INTO A DIGITAL EXPERIENCE PLATFORM (DXP)TURN YOUR DRUPAL INTO A DIGITAL EXPERIENCE PLATFORM (DXP)
TURN YOUR DRUPAL INTO A DIGITAL EXPERIENCE PLATFORM (DXP)
Drupal Portugal
 
COMO CRIAR O TEU STARTUP PROJECT E SETUP DO TEU AMBIENTE DE DESENVOLVIMENTO D...
COMO CRIAR O TEU STARTUP PROJECT E SETUP DO TEU AMBIENTE DE DESENVOLVIMENTO D...COMO CRIAR O TEU STARTUP PROJECT E SETUP DO TEU AMBIENTE DE DESENVOLVIMENTO D...
COMO CRIAR O TEU STARTUP PROJECT E SETUP DO TEU AMBIENTE DE DESENVOLVIMENTO D...
Drupal Portugal
 
Drupal Day Portugal 2020
Drupal Day Portugal 2020Drupal Day Portugal 2020
Drupal Day Portugal 2020
Drupal Portugal
 
Panels: Drupal Cubista
Panels: Drupal CubistaPanels: Drupal Cubista
Panels: Drupal Cubista
Drupal Portugal
 
Como Colaborar na Tradução
Como Colaborar na Tradução Como Colaborar na Tradução
Como Colaborar na Tradução
Drupal Portugal
 
Também há Drupal em Portugal
Também há Drupal em PortugalTambém há Drupal em Portugal
Também há Drupal em Portugal
Drupal Portugal
 
Full Web Stack Security
Full Web Stack SecurityFull Web Stack Security
Full Web Stack Security
Drupal Portugal
 
Rules e Drupal
Rules e DrupalRules e Drupal
Rules e Drupal
Drupal Portugal
 
Temas em Drupal
Temas em DrupalTemas em Drupal
Temas em Drupal
Drupal Portugal
 
Drupal e o seu ecossistema
Drupal e o seu ecossistemaDrupal e o seu ecossistema
Drupal e o seu ecossistema
Drupal Portugal
 
Drupal mapping, a brid's eye view
Drupal mapping, a brid's eye viewDrupal mapping, a brid's eye view
Drupal mapping, a brid's eye view
Drupal Portugal
 
Drupal 7
Drupal 7Drupal 7
Drupal 7
Drupal Portugal
 
Business of Drupal
Business of DrupalBusiness of Drupal
Business of Drupal
Drupal Portugal
 
DrupalCamp Lisboa 2011
DrupalCamp Lisboa 2011DrupalCamp Lisboa 2011
DrupalCamp Lisboa 2011
Drupal Portugal
 
Business Angels e oportunidades de negócio
Business Angels e oportunidades de negócioBusiness Angels e oportunidades de negócio
Business Angels e oportunidades de negócio
Drupal Portugal
 

More from Drupal Portugal (18)

DRUPAL DIGITAL MARKETING CHECKLIST
DRUPAL DIGITAL MARKETING CHECKLISTDRUPAL DIGITAL MARKETING CHECKLIST
DRUPAL DIGITAL MARKETING CHECKLIST
 
Drupal Day Portugal 2020 - Closing Remarks / Encerramento
Drupal Day Portugal 2020 - Closing Remarks / EncerramentoDrupal Day Portugal 2020 - Closing Remarks / Encerramento
Drupal Day Portugal 2020 - Closing Remarks / Encerramento
 
BRANCHING MODELS (workshop)
BRANCHING MODELS (workshop)BRANCHING MODELS (workshop)
BRANCHING MODELS (workshop)
 
TURN YOUR DRUPAL INTO A DIGITAL EXPERIENCE PLATFORM (DXP)
TURN YOUR DRUPAL INTO A DIGITAL EXPERIENCE PLATFORM (DXP)TURN YOUR DRUPAL INTO A DIGITAL EXPERIENCE PLATFORM (DXP)
TURN YOUR DRUPAL INTO A DIGITAL EXPERIENCE PLATFORM (DXP)
 
COMO CRIAR O TEU STARTUP PROJECT E SETUP DO TEU AMBIENTE DE DESENVOLVIMENTO D...
COMO CRIAR O TEU STARTUP PROJECT E SETUP DO TEU AMBIENTE DE DESENVOLVIMENTO D...COMO CRIAR O TEU STARTUP PROJECT E SETUP DO TEU AMBIENTE DE DESENVOLVIMENTO D...
COMO CRIAR O TEU STARTUP PROJECT E SETUP DO TEU AMBIENTE DE DESENVOLVIMENTO D...
 
Drupal Day Portugal 2020
Drupal Day Portugal 2020Drupal Day Portugal 2020
Drupal Day Portugal 2020
 
Panels: Drupal Cubista
Panels: Drupal CubistaPanels: Drupal Cubista
Panels: Drupal Cubista
 
Como Colaborar na Tradução
Como Colaborar na Tradução Como Colaborar na Tradução
Como Colaborar na Tradução
 
Também há Drupal em Portugal
Também há Drupal em PortugalTambém há Drupal em Portugal
Também há Drupal em Portugal
 
Full Web Stack Security
Full Web Stack SecurityFull Web Stack Security
Full Web Stack Security
 
Rules e Drupal
Rules e DrupalRules e Drupal
Rules e Drupal
 
Temas em Drupal
Temas em DrupalTemas em Drupal
Temas em Drupal
 
Drupal e o seu ecossistema
Drupal e o seu ecossistemaDrupal e o seu ecossistema
Drupal e o seu ecossistema
 
Drupal mapping, a brid's eye view
Drupal mapping, a brid's eye viewDrupal mapping, a brid's eye view
Drupal mapping, a brid's eye view
 
Drupal 7
Drupal 7Drupal 7
Drupal 7
 
Business of Drupal
Business of DrupalBusiness of Drupal
Business of Drupal
 
DrupalCamp Lisboa 2011
DrupalCamp Lisboa 2011DrupalCamp Lisboa 2011
DrupalCamp Lisboa 2011
 
Business Angels e oportunidades de negócio
Business Angels e oportunidades de negócioBusiness Angels e oportunidades de negócio
Business Angels e oportunidades de negócio
 

Recently uploaded

SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 

Recently uploaded (20)

SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 

DRUPAL CACHE SYSTEMS AND VARNISH

  • 1. Drupal Day 2020 – Drupal Cache Systems and Varnish Pedro Dias November 2020
  • 3. Internal Dynamic Page CacheInternal Page Caching 3 Every request constructs the output Saves the whole HTML for a given page, useful for a website with anonymous visitors Caches page components instead of the whole page, avoids a component to be computed in every requests if it behaves the same for all the pages Cache turned off Drupal out of the box caching systems
  • 4. 4 Drupal out of the box caching systems What is cacheable in Drupal? —Every renderable element
  • 5. Cache Max-ageCache Contexts 5 • A way of tagging a cacheable element used for bulk invalidation. • Used to create cache related elements • When a cache tag is invalidated, all elements with that tag are invalidated • Appliable to all renderable elements • Custom ones can be created • Provides a way of storing cache contextualized with the incoming request • Analogous to HTTP's Vary header. • Provides the ability for different users to see different cached content • Appliable to all renderable elements • Custom ones can be created • Instructs the time to live of the renderable element cache Cacheability Metadata in Drupal Cache Tags
  • 8. Enhance Drupal with Varnish 8 What is Varnish? - HTTP Accelerator known as HTTP Reverse Proxy - Stores the generated HTML for a given URL and serves the request without hitting the webserver - Speeds up delivery with a factor of 300 - 1000x
  • 9. Enhance Drupal with Varnish 9 Drupal and Varnish - Installing Drupal Varnish Cache Contrib module give the ability to integrate with Cache Tags. - Drupal + Varnish out-of-the-box work like Drupal Internal Page Cache - Same cache for every visitors Icons made by Freepick from www.flaticon.com
  • 10. Enhance Drupal with Varnish 10 Having Drupal + Varnish Installed Contextual response example • Our users have a attribute called “Has car” • We want to deliver different content to the user based on this attribute • Cache contexts won’t work
  • 11. Enhance Drupal with Varnish 11 Means that we cannot serve content based on the request context? • Out of the box no, Varnish caches pages based on the URL • Varnish offers a Vary mechanism to make cache be contextual for the request (Same logic as Drupal Cache-Contexts) • Varnish can be instructed by webserver response how the cache varies using the response Vary header • Vary header should contain which request headers should be used to store the cache based on their combinations • For our example we need to add the request header that contains the attribute value to make it vary
  • 12. Enhance Drupal with Varnish – Initial state 12 Icons made by Freepick from www.flaticon.com
  • 13. Enhance Drupal with Varnish – Adding the CDN 13 Icons made by Freepick from www.flaticon.com
  • 14. Enhance Drupal with Varnish – Make Info about car available on client-side 14 Icons made by Freepick from www.flaticon.com
  • 15. Enhance Drupal with Varnish – Add the cookie value as a Request header by CDN 15 Icons made by Freepick from www.flaticon.com
  • 16. Enhance Drupal with Varnish – Make cache Vary by X-Has-Car header 16 Icons made by Freepick from www.flaticon.com
  • 17. Enhance Drupal with Varnish - Summary 17 Summary • Value needed for cache to Vary passed to client side using a cookie • Leverage the use of a CDN to transform a cookie into a Request Header • Drupal instructs Varnish to Vary cache based on that header Icons made by Freepick from www.flaticon.com
  • 18. Enhance Drupal with Varnish – Combine with Cache contexts 18 Combine Varnish and Drupal cache • Cache contexts continue to make sense in reusable components • Enhances performance on shared components • Pages in which the content is different from the path should use the before explained mechanism
  • 19. Enhance Drupal with Varnish 19 Tips to handle cache problems • Remember that the first hit is always cached • Setup http.response.debug_cacheability_headers in services.yml and check X-Drupal-Cache-Contexts • For debugging Varnish you can pass all the request headers started to X to the response