The Full Page Cache is an essential part of Magento 2. All modules with any frontend components have to be developed with Varnish in mind, in order for a site to meet scalability requirements.
Caching is easy if all pages look the same for all customers, but what if they need individualization?
The Magento 2 framework provides several tools to deal with this scenario, each providing a varying degree of flexibility and having different costs of implementation.
In this short presentation Vinai guided you through the steps required to display private data on cached catalog pages in a secure manner. He used the most flexible approach provided by the framework, but boiled down to it’s essentials, thereby reducing the complexity as much as possible.
The goal of the presentation is to equip you with an understanding of how private customer data can be displayed fully cached pages.
11. MOST PAGES
ARE MIXED:
PUBLIC + SHARED + PRIVATE
CACHE HITS + MISSES
(c) Vinai Kopp - http://vinaikopp.com - twitter://@VinaiKopp - Meet Magento IT on 2018-05-25
12. REMEMBER:
(c) Vinai Kopp - http://vinaikopp.com - twitter://@VinaiKopp - Meet Magento IT on 2018-05-25
13. THE LESSPRIVATE AND DYNAMIC DATA A PAGE HAS,
THE BETTER
THE FPC WILL WORK!
(c) Vinai Kopp - http://vinaikopp.com - twitter://@VinaiKopp - Meet Magento IT on 2018-05-25
14. Ready for some details?
(c) Vinai Kopp - http://vinaikopp.com - twitter://@VinaiKopp - Meet Magento IT on 2018-05-25
15. ADDING
PRIVATE DATA
TO A PAGE IN
MAGENTO 2
(A.K.A HOLEPUNCHING)
(c) Vinai Kopp - http://vinaikopp.com - twitter://@VinaiKopp - Meet Magento IT on 2018-05-25
23. 2. In etc/frontend/di.xml:
add section to
SectionPool
argument
sectionSourceMap
(c) Vinai Kopp - http://vinaikopp.com - twitter://@VinaiKopp - Meet Magento IT on 2018-05-25
24. 3. In etc/frontend/sections.xml:
list actions to cause section refresh
(c) Vinai Kopp - http://vinaikopp.com - twitter://@VinaiKopp - Meet Magento IT on 2018-05-25
27. Thank you for your attention!
!
Questions? !
! Source: https://github.com/Vinai/VinaiKopp-FavoriteProducts-Example/
(c) Vinai Kopp - http://vinaikopp.com - twitter://@VinaiKopp - Meet Magento IT on 2018-05-25