SlideShare a Scribd company logo
1 of 14
Download to read offline
Varnish in Magento 2
By Toon Van Dooren
Varnish?
Varnish Webserver
MissHIT
Cache invalidation
Ban Purge
Intelligent cache invalidation Direct invalidation
Cache object exists until it is fetched from
backend
Instant object removal from cache
Exists until older than the oldest cache
object
Does not stay in memory
Everything that is known to Varnish (URLs,
IPs, Headers, …)
URLs
Cache invalidation
- Content tagging
- Object Identifiers in header
- X-Magento-Tags: catalog_product_14
- Ban specific objects
- ban obj.http.X-Magento-Tags ~ “catalog_product_14”
- Useful for
- Objects that can exist in multiple pages
- Paginated and sorted content
- Search pages
Hole punching
Esi Ajax
Has impact on pageload Async
Processed by Varnish + Webserver Processed by browser + web server
Private or public User specific (private)
Usage: crucial elements (navigation) Usage: independent elements (top cart)
Hole punching
- Avoid permanent hole punches
- Events: add to cart, login, …
- Leverage local storage or lifetimes combined
with bans
- Avoid unnecessary hole punches
- Does this content need to be invalidated?
- Local storage: https://github.com/toonvd/magento-localstorage-recentlyviewed
Magento 2 functionalities
- Purge to ban
- Esi for shorter lifetimes
- Ajax + local storage for hole punching
- Content tagging
- Segmentation
- Caching static content
Purge to ban
ESI
MagentoPageCacheControllerBlockEsi
Ajax + localstorage
- Localstorage
- mage-cache-storage
- mage-cache-storage-section-invalidation
- mage-cache-timeouts
- Copies localstorage content to placeholder
- Event -> ajax call -> localstorage -> copy
- customer-data.js
Content tagging
- X-Magento-Tags
- Data object name + id
- Object models extend IdentityInterface
- MagentoFrameworkDataObjectIdentityInterface
- getIdentities returns a string with tags
- Abstractblock adds tags
- MagentoFrameworkViewElementAbstractBlock
- Purgecache model purges tags on object save
- MagentoCacheInvalidateModelPurgeCache
Segmentation
- X-Magento-Vary
- Plugin around http context dispatch
- MagentoFrameworkAppHttpContext
- Set value to add it to the header
- Context class hashes all set values
- HTTP class adds the vary header
- Vary header is added to Varnish hash
Before you begin
- Varnish is not the holy grail of performance
- Optimize your backend first!
- Do not use Varnish to hide bad coding
- Learn how to read / use Varnish Configuration Language
- Know your subroutines
- Know how to utilize them
- Personalise your VCL based on your needs
- Composing your VCL is not a sysadmin task!
- Decide whether you will cache static content
- Do you have enough RAM?
- Globalization needed? (Content Delivery Network)
Questions?
- Varnish?
- Cache invalidation
- Hole punching
- Varnish in Magento 2
- Functionalities + Quick dive
- Purge to ban
- ESI
- Ajax + local storage
- Content tagging
- Segmentation

More Related Content

What's hot

Persistent Offline Storage White
Persistent Offline Storage WhitePersistent Offline Storage White
Persistent Offline Storage WhiteAlexei White
 
When dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWhen dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWim Godden
 
Browser Internals-Same Origin Policy
Browser Internals-Same Origin PolicyBrowser Internals-Same Origin Policy
Browser Internals-Same Origin PolicyKrishna T
 
Real World Caching with Ruby on Rails
Real World Caching with Ruby on RailsReal World Caching with Ruby on Rails
Real World Caching with Ruby on RailsDavid Roberts
 
Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Ivan Chepurnyi
 
Lt local storage
Lt local storageLt local storage
Lt local storageYuzu Saijo
 

What's hot (10)

ASP.NET View State - Security Issues
ASP.NET View State - Security IssuesASP.NET View State - Security Issues
ASP.NET View State - Security Issues
 
Persistent Offline Storage White
Persistent Offline Storage WhitePersistent Offline Storage White
Persistent Offline Storage White
 
Ecom2
Ecom2Ecom2
Ecom2
 
Advance Java
Advance JavaAdvance Java
Advance Java
 
WS-* with WCF
WS-* with WCFWS-* with WCF
WS-* with WCF
 
When dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWhen dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniques
 
Browser Internals-Same Origin Policy
Browser Internals-Same Origin PolicyBrowser Internals-Same Origin Policy
Browser Internals-Same Origin Policy
 
Real World Caching with Ruby on Rails
Real World Caching with Ruby on RailsReal World Caching with Ruby on Rails
Real World Caching with Ruby on Rails
 
Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!
 
Lt local storage
Lt local storageLt local storage
Lt local storage
 

Viewers also liked

Ahmed Abdel-Mawla Abdel-Hamid (CV)
Ahmed Abdel-Mawla Abdel-Hamid (CV)Ahmed Abdel-Mawla Abdel-Hamid (CV)
Ahmed Abdel-Mawla Abdel-Hamid (CV)Ahmed Hassan
 
Salones para Bodas en Malaga | Hacienda Romeral del Rocio
Salones para Bodas en Malaga | Hacienda Romeral del RocioSalones para Bodas en Malaga | Hacienda Romeral del Rocio
Salones para Bodas en Malaga | Hacienda Romeral del RocioHacienda Romeral del Rocío
 
Lição 10 juvenil 2° trimestre 2015
Lição 10 juvenil   2° trimestre 2015Lição 10 juvenil   2° trimestre 2015
Lição 10 juvenil 2° trimestre 2015Joel da Silva
 
Presentación biodiversidad, contaminación y manejo de residuos sulma aular
Presentación biodiversidad, contaminación y manejo de residuos sulma aularPresentación biodiversidad, contaminación y manejo de residuos sulma aular
Presentación biodiversidad, contaminación y manejo de residuos sulma aularSulma Aular
 
Abdomen agudo qx en pediatría
Abdomen agudo qx en pediatríaAbdomen agudo qx en pediatría
Abdomen agudo qx en pediatríaMICHAEL GUTARRA
 
Hack wifi password using kali linux
Hack wifi password using kali linuxHack wifi password using kali linux
Hack wifi password using kali linuxHelder Oliveira
 

Viewers also liked (11)

Ahmed Abdel-Mawla Abdel-Hamid (CV)
Ahmed Abdel-Mawla Abdel-Hamid (CV)Ahmed Abdel-Mawla Abdel-Hamid (CV)
Ahmed Abdel-Mawla Abdel-Hamid (CV)
 
Salones para Bodas en Malaga | Hacienda Romeral del Rocio
Salones para Bodas en Malaga | Hacienda Romeral del RocioSalones para Bodas en Malaga | Hacienda Romeral del Rocio
Salones para Bodas en Malaga | Hacienda Romeral del Rocio
 
Lição 10 juvenil 2° trimestre 2015
Lição 10 juvenil   2° trimestre 2015Lição 10 juvenil   2° trimestre 2015
Lição 10 juvenil 2° trimestre 2015
 
Presentación biodiversidad, contaminación y manejo de residuos sulma aular
Presentación biodiversidad, contaminación y manejo de residuos sulma aularPresentación biodiversidad, contaminación y manejo de residuos sulma aular
Presentación biodiversidad, contaminación y manejo de residuos sulma aular
 
Zodiac Health and Wellness Personality Development Workshop by Amb Juan
Zodiac Health and Wellness Personality Development Workshop by Amb Juan Zodiac Health and Wellness Personality Development Workshop by Amb Juan
Zodiac Health and Wellness Personality Development Workshop by Amb Juan
 
Peshawar attack
Peshawar attackPeshawar attack
Peshawar attack
 
Bridging the Gap to Productivity TEAM BUILDING WORKSHOP by Amb Juan
Bridging the Gap to Productivity TEAM BUILDING WORKSHOP by Amb JuanBridging the Gap to Productivity TEAM BUILDING WORKSHOP by Amb Juan
Bridging the Gap to Productivity TEAM BUILDING WORKSHOP by Amb Juan
 
Mechanical project @sris
Mechanical project @srisMechanical project @sris
Mechanical project @sris
 
Abdomen agudo qx en pediatría
Abdomen agudo qx en pediatríaAbdomen agudo qx en pediatría
Abdomen agudo qx en pediatría
 
Vertebrates
VertebratesVertebrates
Vertebrates
 
Hack wifi password using kali linux
Hack wifi password using kali linuxHack wifi password using kali linux
Hack wifi password using kali linux
 

Similar to Magento 2 Seminar - Toon van Dooren - Varnish in Magento 2

High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesStoyan Stefanov
 
Иван Чепурный - Meet Magento Ukraine - Varnish Cache and its usage in the rea...
Иван Чепурный - Meet Magento Ukraine - Varnish Cache and its usage in the rea...Иван Чепурный - Meet Magento Ukraine - Varnish Cache and its usage in the rea...
Иван Чепурный - Meet Magento Ukraine - Varnish Cache and its usage in the rea...Atwix
 
Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Stephan Hochdörfer
 
Présentation du générateur de site statique eleventy
Présentation du générateur de site statique eleventyPrésentation du générateur de site statique eleventy
Présentation du générateur de site statique eleventyGilles Vauvarin
 
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...shesmer
 
Accelerating Rails with edge caching
Accelerating Rails with edge cachingAccelerating Rails with edge caching
Accelerating Rails with edge cachingMichael May
 
Using html5 to build offline applications
Using html5 to build offline applicationsUsing html5 to build offline applications
Using html5 to build offline applicationsWoody Pewitt
 
Caching in WordPress
Caching in WordPressCaching in WordPress
Caching in WordPressTareq Hasan
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingBertrand Delacretaz
 
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
 
RESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsRESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsSven Wolfermann
 
Resource registries plone conf 2014
Resource registries plone conf 2014Resource registries plone conf 2014
Resource registries plone conf 2014Ramon Navarro
 
Modular android Project
Modular android ProjectModular android Project
Modular android ProjectRaka Mogandhi
 
Rails for Mobile Devices @ Conferencia Rails 2011
Rails for Mobile Devices @ Conferencia Rails 2011Rails for Mobile Devices @ Conferencia Rails 2011
Rails for Mobile Devices @ Conferencia Rails 2011Alberto Perdomo
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 

Similar to Magento 2 Seminar - Toon van Dooren - Varnish in Magento 2 (20)

High Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practicesHigh Performance Web Pages - 20 new best practices
High Performance Web Pages - 20 new best practices
 
HTML5와 모바일
HTML5와 모바일HTML5와 모바일
HTML5와 모바일
 
Иван Чепурный - Meet Magento Ukraine - Varnish Cache and its usage in the rea...
Иван Чепурный - Meet Magento Ukraine - Varnish Cache and its usage in the rea...Иван Чепурный - Meet Magento Ukraine - Varnish Cache and its usage in the rea...
Иван Чепурный - Meet Magento Ukraine - Varnish Cache and its usage in the rea...
 
Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13Offline strategies for HTML5 web applications - ConFoo13
Offline strategies for HTML5 web applications - ConFoo13
 
Local storage
Local storageLocal storage
Local storage
 
Dandelion 0.10.0
Dandelion 0.10.0Dandelion 0.10.0
Dandelion 0.10.0
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Présentation du générateur de site statique eleventy
Présentation du générateur de site statique eleventyPrésentation du générateur de site statique eleventy
Présentation du générateur de site statique eleventy
 
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
 
Accelerating Rails with edge caching
Accelerating Rails with edge cachingAccelerating Rails with edge caching
Accelerating Rails with edge caching
 
Using html5 to build offline applications
Using html5 to build offline applicationsUsing html5 to build offline applications
Using html5 to build offline applications
 
Always on! Or not?
Always on! Or not?Always on! Or not?
Always on! Or not?
 
Caching in WordPress
Caching in WordPressCaching in WordPress
Caching in WordPress
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
 
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
 
RESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsRESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side Components
 
Resource registries plone conf 2014
Resource registries plone conf 2014Resource registries plone conf 2014
Resource registries plone conf 2014
 
Modular android Project
Modular android ProjectModular android Project
Modular android Project
 
Rails for Mobile Devices @ Conferencia Rails 2011
Rails for Mobile Devices @ Conferencia Rails 2011Rails for Mobile Devices @ Conferencia Rails 2011
Rails for Mobile Devices @ Conferencia Rails 2011
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 

More from Yireo

Faster Magento Integration Tests
Faster Magento Integration TestsFaster Magento Integration Tests
Faster Magento Integration TestsYireo
 
Mage-OS Nederland
Mage-OS NederlandMage-OS Nederland
Mage-OS NederlandYireo
 
Modernizing Vue Storefront 1
Modernizing Vue Storefront 1Modernizing Vue Storefront 1
Modernizing Vue Storefront 1Yireo
 
Magento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshop
Magento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshopMagento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshop
Magento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshopYireo
 
Magento 2 Seminar - Andra Lungu - API in Magento 2
Magento 2 Seminar - Andra Lungu - API in Magento 2Magento 2 Seminar - Andra Lungu - API in Magento 2
Magento 2 Seminar - Andra Lungu - API in Magento 2Yireo
 
Magento 2 Seminar - Roger Keulen - Machine learning
Magento 2 Seminar - Roger Keulen - Machine learningMagento 2 Seminar - Roger Keulen - Machine learning
Magento 2 Seminar - Roger Keulen - Machine learningYireo
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishYireo
 
Magento 2 Seminar - Maarten Schuiling - The App Economy
Magento 2 Seminar - Maarten Schuiling - The App EconomyMagento 2 Seminar - Maarten Schuiling - The App Economy
Magento 2 Seminar - Maarten Schuiling - The App EconomyYireo
 
Magento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelen
Magento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelenMagento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelen
Magento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelenYireo
 
Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2
Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2
Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2Yireo
 
Magento 2 Seminar - Arjen Miedema - Search Engine Optimisation
Magento 2 Seminar - Arjen Miedema - Search Engine OptimisationMagento 2 Seminar - Arjen Miedema - Search Engine Optimisation
Magento 2 Seminar - Arjen Miedema - Search Engine OptimisationYireo
 
Magento 2 Seminar - Tjitte Folkertsma - Beaumotica
Magento 2 Seminar - Tjitte Folkertsma - BeaumoticaMagento 2 Seminar - Tjitte Folkertsma - Beaumotica
Magento 2 Seminar - Tjitte Folkertsma - BeaumoticaYireo
 
Magento 2 Seminar - Jeroen Vermeulen Snelle Magento 2 Shops
Magento 2 Seminar - Jeroen Vermeulen  Snelle Magento 2 ShopsMagento 2 Seminar - Jeroen Vermeulen  Snelle Magento 2 Shops
Magento 2 Seminar - Jeroen Vermeulen Snelle Magento 2 ShopsYireo
 
Magento 2 Seminar - Christian Muench - Magerun2
Magento 2 Seminar - Christian Muench - Magerun2Magento 2 Seminar - Christian Muench - Magerun2
Magento 2 Seminar - Christian Muench - Magerun2Yireo
 
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryMagento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryYireo
 
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarks
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarksMagento 2 Seminar - Daniel Genis - Magento 2 benchmarks
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarksYireo
 
Magento 2 Seminar - Ben Marks - Keynote
Magento 2 Seminar - Ben Marks - KeynoteMagento 2 Seminar - Ben Marks - Keynote
Magento 2 Seminar - Ben Marks - KeynoteYireo
 
Magento 2 Seminar - Community agenda
Magento 2 Seminar - Community agendaMagento 2 Seminar - Community agenda
Magento 2 Seminar - Community agendaYireo
 
Magento 2 Seminar - Jisse Reitsma - Migratie Planning
Magento 2 Seminar - Jisse Reitsma - Migratie PlanningMagento 2 Seminar - Jisse Reitsma - Migratie Planning
Magento 2 Seminar - Jisse Reitsma - Migratie PlanningYireo
 
Magento 2 Seminar - Welkom
Magento 2 Seminar - WelkomMagento 2 Seminar - Welkom
Magento 2 Seminar - WelkomYireo
 

More from Yireo (20)

Faster Magento Integration Tests
Faster Magento Integration TestsFaster Magento Integration Tests
Faster Magento Integration Tests
 
Mage-OS Nederland
Mage-OS NederlandMage-OS Nederland
Mage-OS Nederland
 
Modernizing Vue Storefront 1
Modernizing Vue Storefront 1Modernizing Vue Storefront 1
Modernizing Vue Storefront 1
 
Magento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshop
Magento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshopMagento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshop
Magento 2 Seminar - Peter-Jaap Blaakmeer - VR-webshop
 
Magento 2 Seminar - Andra Lungu - API in Magento 2
Magento 2 Seminar - Andra Lungu - API in Magento 2Magento 2 Seminar - Andra Lungu - API in Magento 2
Magento 2 Seminar - Andra Lungu - API in Magento 2
 
Magento 2 Seminar - Roger Keulen - Machine learning
Magento 2 Seminar - Roger Keulen - Machine learningMagento 2 Seminar - Roger Keulen - Machine learning
Magento 2 Seminar - Roger Keulen - Machine learning
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
 
Magento 2 Seminar - Maarten Schuiling - The App Economy
Magento 2 Seminar - Maarten Schuiling - The App EconomyMagento 2 Seminar - Maarten Schuiling - The App Economy
Magento 2 Seminar - Maarten Schuiling - The App Economy
 
Magento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelen
Magento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelenMagento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelen
Magento 2 Seminar - Jisse Reitsma - Magento 2 techniek vertalen naar voordelen
 
Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2
Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2
Magento 2 Seminar - Sander Mangel - Van Magento 1 naar 2
 
Magento 2 Seminar - Arjen Miedema - Search Engine Optimisation
Magento 2 Seminar - Arjen Miedema - Search Engine OptimisationMagento 2 Seminar - Arjen Miedema - Search Engine Optimisation
Magento 2 Seminar - Arjen Miedema - Search Engine Optimisation
 
Magento 2 Seminar - Tjitte Folkertsma - Beaumotica
Magento 2 Seminar - Tjitte Folkertsma - BeaumoticaMagento 2 Seminar - Tjitte Folkertsma - Beaumotica
Magento 2 Seminar - Tjitte Folkertsma - Beaumotica
 
Magento 2 Seminar - Jeroen Vermeulen Snelle Magento 2 Shops
Magento 2 Seminar - Jeroen Vermeulen  Snelle Magento 2 ShopsMagento 2 Seminar - Jeroen Vermeulen  Snelle Magento 2 Shops
Magento 2 Seminar - Jeroen Vermeulen Snelle Magento 2 Shops
 
Magento 2 Seminar - Christian Muench - Magerun2
Magento 2 Seminar - Christian Muench - Magerun2Magento 2 Seminar - Christian Muench - Magerun2
Magento 2 Seminar - Christian Muench - Magerun2
 
Magento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 SummaryMagento 2 Seminar - Anton Kril - Magento 2 Summary
Magento 2 Seminar - Anton Kril - Magento 2 Summary
 
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarks
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarksMagento 2 Seminar - Daniel Genis - Magento 2 benchmarks
Magento 2 Seminar - Daniel Genis - Magento 2 benchmarks
 
Magento 2 Seminar - Ben Marks - Keynote
Magento 2 Seminar - Ben Marks - KeynoteMagento 2 Seminar - Ben Marks - Keynote
Magento 2 Seminar - Ben Marks - Keynote
 
Magento 2 Seminar - Community agenda
Magento 2 Seminar - Community agendaMagento 2 Seminar - Community agenda
Magento 2 Seminar - Community agenda
 
Magento 2 Seminar - Jisse Reitsma - Migratie Planning
Magento 2 Seminar - Jisse Reitsma - Migratie PlanningMagento 2 Seminar - Jisse Reitsma - Migratie Planning
Magento 2 Seminar - Jisse Reitsma - Migratie Planning
 
Magento 2 Seminar - Welkom
Magento 2 Seminar - WelkomMagento 2 Seminar - Welkom
Magento 2 Seminar - Welkom
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
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
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

Magento 2 Seminar - Toon van Dooren - Varnish in Magento 2

  • 1. Varnish in Magento 2 By Toon Van Dooren
  • 3. Cache invalidation Ban Purge Intelligent cache invalidation Direct invalidation Cache object exists until it is fetched from backend Instant object removal from cache Exists until older than the oldest cache object Does not stay in memory Everything that is known to Varnish (URLs, IPs, Headers, …) URLs
  • 4. Cache invalidation - Content tagging - Object Identifiers in header - X-Magento-Tags: catalog_product_14 - Ban specific objects - ban obj.http.X-Magento-Tags ~ “catalog_product_14” - Useful for - Objects that can exist in multiple pages - Paginated and sorted content - Search pages
  • 5. Hole punching Esi Ajax Has impact on pageload Async Processed by Varnish + Webserver Processed by browser + web server Private or public User specific (private) Usage: crucial elements (navigation) Usage: independent elements (top cart)
  • 6. Hole punching - Avoid permanent hole punches - Events: add to cart, login, … - Leverage local storage or lifetimes combined with bans - Avoid unnecessary hole punches - Does this content need to be invalidated? - Local storage: https://github.com/toonvd/magento-localstorage-recentlyviewed
  • 7. Magento 2 functionalities - Purge to ban - Esi for shorter lifetimes - Ajax + local storage for hole punching - Content tagging - Segmentation - Caching static content
  • 10. Ajax + localstorage - Localstorage - mage-cache-storage - mage-cache-storage-section-invalidation - mage-cache-timeouts - Copies localstorage content to placeholder - Event -> ajax call -> localstorage -> copy - customer-data.js
  • 11. Content tagging - X-Magento-Tags - Data object name + id - Object models extend IdentityInterface - MagentoFrameworkDataObjectIdentityInterface - getIdentities returns a string with tags - Abstractblock adds tags - MagentoFrameworkViewElementAbstractBlock - Purgecache model purges tags on object save - MagentoCacheInvalidateModelPurgeCache
  • 12. Segmentation - X-Magento-Vary - Plugin around http context dispatch - MagentoFrameworkAppHttpContext - Set value to add it to the header - Context class hashes all set values - HTTP class adds the vary header - Vary header is added to Varnish hash
  • 13. Before you begin - Varnish is not the holy grail of performance - Optimize your backend first! - Do not use Varnish to hide bad coding - Learn how to read / use Varnish Configuration Language - Know your subroutines - Know how to utilize them - Personalise your VCL based on your needs - Composing your VCL is not a sysadmin task! - Decide whether you will cache static content - Do you have enough RAM? - Globalization needed? (Content Delivery Network)
  • 14. Questions? - Varnish? - Cache invalidation - Hole punching - Varnish in Magento 2 - Functionalities + Quick dive - Purge to ban - ESI - Ajax + local storage - Content tagging - Segmentation