SlideShare a Scribd company logo
1
#mconf15 @rah003
Magnolia Conference • Wednesday, June 10, 2015 • Basel, Switzerland, Europe, Earth, Solar System, Milky Way
Dynamic Page Caching
in Magnolia 5.4
2
Jan HaderkaRoman Kovařík
#mconf15 @rah003
3
2015 Magnolia 5.4
2014 Magnolia 5.3
#mconf15 @rah003
in Magnolia 5.4
4
State of Cache
Flickr / Taro Taylor
#mconf15 @rah003
5
Cache?
Just one?
FM TL Cache
Browser Cache
HttpResp Cache
Unsplash
RestReq Cache
RegistriesJR Item Cache
#mconf15 @rah003
Cache is a trade-off between perceived
performance of a system, internal resource
allocation and currentness of delivered data
6
Do we need more?
Flickr / Kenny Louie
#mconf15 @rah003
7
Cache implementation
Flickr / A Syn
Restructured & improved
#mconf15 @rah003
8
Cache module structure
Flickr / A Syn
#mconf15 @rah003
9
Cache implementation
Flickr / A Syn
Separate config per cache
#mconf15 @rah003
10 Flickr / A Syn
#mconf15 @rah003
11
Cache implementation
Flickr / A Syn
Site-aware CacheFilter
#mconf15 @rah003
12 Flickr / A Syn
#mconf15 @rah003
13 Flickr / A Syn
#mconf15 @rah003
14
Cache implementation
Flickr / A Syn
Cache core, impl and UI
are now separate
#mconf15 @rah003
15
Cache module structure
Flickr / A Syn
#mconf15 @rah003
16
Cache implementation
Flickr / A Syn
ehCache 1.5 replaced w/ 2.10
#mconf15 @rah003
17 Flickr / A Syn
#mconf15 @rah003
ehCahe 1.5 ehCahe 2.10
18
new ehCache
Flickr / A Syn
5-10% better performance
#mconf15 @rah003
19 Flickr / A Syn
#mconf15 @rah003
20
new ehCache
Flickr / A Syn
no more disk persistence
#mconf15 @rah003
21
no disk persistence?
Flickr / A Syn
• cache is for production use
• when do you restart prod server?
• on update
• on crash
#mconf15 @rah003
22
no disk persistence?
Flickr / A Syn
drop-in replacement w/
persistence is BigMemory
#mconf15 @rah003
23
Cache implementation
Flickr / A Syn
new Memcached impl
#mconf15 @rah003
24
Why Memcached?
Flickr / A Syn
separate servers
#mconf15 @rah003
25 Flickr / A Syn
#mconf15 @rah003
26
Why Memcached?
Flickr / A Syn
clusterable
#mconf15 @rah003
27 Flickr / A Syn
#mconf15 @rah003
28
Why Memcached?
Flickr / A Syn
eternal
#mconf15 @rah003
29 Flickr / A Syn
#mconf15 @rah003
30
Why Memcached?
Flickr / A Syn
shareable
#mconf15 @rah003
31 Flickr / A Syn
#mconf15 @rah003
32
Why Memcached?
Flickr / A Syn
double performance when
serving first request*
#mconf15 @rah003
* measured with two public instances connected to same memcached server
33 Flickr / A Syn
#mconf15 @rah003
34 Flickr / A Syn
#mconf15 @rah003
35
Cache implementation
Flickr / A Syn
new Supercache impl
#mconf15 @rah003
36
Why Supercache
Flickr / A Syn
external & persistent
#mconf15 @rah003
37
Why Supercache
Flickr / A Syn
served by load balancer
#mconf15 @rah003
38
Why Supercache
Flickr / A Syn
available for onDemand
and sysEleven hosting
#mconf15 @rah003
39
Cache tools
Flickr / A Syn
new Cache browser app
#mconf15 @rah003
40 Flickr / A Syn
#mconf15 @rah003
41 Flickr / A Syn
#mconf15 @rah003
42 Flickr / A Syn
#mconf15 @rah003
43
Cache Browser
Flickr / A Syn
explore your cache
#mconf15 @rah003
44 Flickr / A Syn
#mconf15 @rah003
45
Cache Browser
Flickr / A Syn
exercise control
#mconf15 @rah003
46 Flickr / A Syn
#mconf15 @rah003
47
Cache Browser
Flickr / A Syn
one that rules them all
#mconf15 @rah003
48 Flickr / A Syn
#mconf15 @rah003
49
In summary
Flickr / A Syn
•auto-discovery
•using REST
•single point of control
•implementation agnostic
#mconf15 @rah003
50
Cache Browser
Flickr / A Syn
#mconf15 @rah003
Demo time?
51 Flickr / A Syn
#mconf15 @rah003
52
What about personalised pages?
Flickr / A Syn
They are now cached too
#mconf15 @rah003
53
How?
Flickr / A Syn
•p13n provides variant info into the
cache key
•Each variant gets it’s own cache entry
#mconf15 @rah003
54
Can personalised pages share
fragments?
Flickr / A Syn
Yes, you need to:
• configure such fragment as dynamic
• use custom cache key generator
#mconf15 @rah003
55
Why not to share by default?
Flickr / A Syn
• complexity
• performance
#mconf15 @rah003
56
Advanced Cache
Flickr / A Syn
Dynamic Page Caching
DPC
#mconf15 @rah003
57
Dynamic?
Flickr / A Syn
Isn’t dynamic
non-cacheable?
#mconf15 @rah003
58
Dynamic?
Flickr / A Syn
“dynamic pages are composed
of fragments of content with
different time-to-live”
#mconf15 @rah003
59
So how do you do it?
Flickr / A Syn
Just render the page ;)
#mconf15 @rah003
60 Flickr / A Syn
#mconf15 @rah003
http://my.domain.com/travel
http://my.domain.com/travel/main/0
http://my.domain.com/travel/
footer/04
http://my.domain.com/travel/footer/03
http://my.domain.com/travel/footer/02
http://my.domain.com/travel/
footer/01
61
Magnolia meets SiteMesh
Flickr / A Syn
#mconf15 @rah003
62
Magnolia meets SiteMesh
Flickr / A Syn
#mconf15 @rah003
63
Listen to HTML only
Flickr / A Syn
#mconf15 @rah003
64
Inject content for components
Flickr / A Syn
#mconf15 @rah003
65
What tags?
Flickr / A Syn
#mconf15 @rah003
<mgnl:injecturi target=“/demo-
project/about~mgnlArea=branding~”
X-Magnolia-Fragment=“sitemesh=skip,
ttl=0" >
66
And those tags,
Flickr / A Syn
they got in, how exactly?
#mconf15 @rah003
67 Flickr / A Syn
#mconf15 @rah003
listener.beforeRender()
listener.afterRender()
68
Tags? Yeah, I did those!
Flickr / A Syn
#mconf15 @rah003
Home address: 

config:/server/rendering/engine/listeners
69
Is this configured?
Flickr / A Syn
#mconf15 @rah003
70
In summary
Flickr / A Syn
• RenderingListener will inject tags
• SiteMeshFilter will replace tags with
cached (or rendered entries) of content
• SiteMesh lives in the chain before
Cache, so it is all transparent to it
#mconf15 @rah003
71
In summary
Flickr / A Syn
• Page can consist of multiple fragments
with different TTL
• Upon expiration content will be 

re-rendered
• Cache filter will cache whatever
requested, fragment or full page#mconf15 @rah003
72
Remember
Flickr / A Syn
The main goal of DPC is improving
performance. This is done by caching
non-dynamic portions of a page
#mconf15 @rah003
73
BEWARE!
Flickr / A Syn
Every dynamic component needs to be
requested separately. That means, more
dynamic components = more time to render.
#mconf15 @rah003
74
BEWARE!
Flickr / A Syn
more dynamic components = slower rendering
Consider excluding such page from the cache!
#mconf15 @rah003
75
BEWARE!
Flickr / A Syn
Although recursive dynamic fragments
are supported, it doesn't make sense to
use this feature unless nested
components have different TTL.
#mconf15 @rah003
76
BEWARE!
Flickr / A Syn
Group of dynamic components

located next to each other

will be rendered faster

in one dynamic area rather than

each separately.
#mconf15 @rah003
77
Say it really works,
Flickr / A Syn
but does it actually scale?
#mconf15 @rah003
78
Performance ✔
Flickr / A Syn
#mconf15 @rah003
Page=cached
SiteMesh=false
Page=cached
SiteMesh=true
Snippets:
none
Page=cached
SiteMesh=true
Snippets:
1cached
Page=cached
SiteMesh=true
Snippets:
1uncached
Page=uncached
SiteMesh=false
Page=uncached
SiteMesh=true
TTFB 0.00233 0.00311 0.004119 0.04095 0.04864 0.06377
Total 0.00275 0.00315 0.004142 0.04143 0.06443 0.06418
% TTFB 5 6 8 84 100 131
% Total 4 5 6 64 100 100
79
Can same fragment be shared by
multiple pages?
Flickr / A Syn
yes, but you need custom cache
key/generator (just like p13n)
#mconf15 @rah003
80
#mconf15 @rah003
Thanks!
Questions?
81
Backup
82
NonCacheableEntry
Flickr / A Syn
anti-coagulant for your
pipeline
#mconf15 @rah003
83
NonCacheableEntry
Flickr / A Syn
#mconf15 @rah003
PersonalizationAnalytics Commerce CRM
www Mobile Site Newsletter Landing PageApp
Integration/Inbound
Multi-Channel OutboundMulti-Channel Outbound
PersonalizationAnalytics Commerce CRM
www Mobile Site Newsletter Landing PageApp
Dynamic page caching for Magnolia 5.4
86 Unsplash / Maja Petric
Integrations
Google
Analytics
IBM
Digital
Analytics
AWSJelastic
IBM
Bluemix
Groovy Spring
LDAP
/ADNTLM
Alfresco
Canto
Cumulus
Bright-
cove
Share-
point Photo-
shop
Magento
Hybris
KonaKart
IBM
Smarter
Commerce
Salesforce
SugarCRM
Campaign
Monitor
Click-
density
Eloqua
Optimizely
Steelhouse
Canvas
Atom
/RSS
AddThis
Facebook
Flickr
Share-
This
Twitter
Apache
Solr
Apache
OFBiz
SAP
87
✔
✔
✔
✔
✔

More Related Content

PPTX
Seattle Code Camp 2016 - .Net Core
PDF
Theming Volto
PDF
Rails on HBase
PDF
The new visana website how to fit a square peg into a round hole
PDF
Velocity - Edge UG
PDF
The Need For Speed - NEBytes
PDF
Balancing Act of Caching LoopConf 2018
PDF
The Need For Speed - NxtGen Cambridge
Seattle Code Camp 2016 - .Net Core
Theming Volto
Rails on HBase
The new visana website how to fit a square peg into a round hole
Velocity - Edge UG
The Need For Speed - NEBytes
Balancing Act of Caching LoopConf 2018
The Need For Speed - NxtGen Cambridge

Similar to Dynamic page caching for Magnolia 5.4 (20)

PDF
Velocity - NxtGen Oxford
PPTX
WordPress performance tuning
PPTX
SUG Bangalore - Kick Off Session
PPTX
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
PDF
The Need for Speed - EpiCenter 2010
PDF
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
PPTX
20 x Tips to better Optimize your Flash content
PDF
ConFoo 2016: Development to Deployment
PPTX
Silverlight vs HTML5 - Lessons learned from the real world...
PDF
FuelPHP - a PHP HMVC Framework by silicongulf.com
PPTX
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
PPTX
Building Rackspace Cloud Monitoring
PDF
5 Arguments Against Kanban
PPTX
Web and App Performance: Top Problems to avoid to keep you out of the News
PPTX
Introduction to Progressive Web Apps / Meet Magento PL 2018
PDF
Http/2 - What's it all about?
PDF
Adopting Fortune 500 Scaling Tactics from Day One.pdf
PDF
ColdFusion Summit 2016 - Bringing Order to the Chaos: Take the MVC Plunge
PDF
Bring Order to the Chaos: Take the MVC Plunge
PPTX
A Dive Into Containers and Docker
Velocity - NxtGen Oxford
WordPress performance tuning
SUG Bangalore - Kick Off Session
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
The Need for Speed - EpiCenter 2010
Phil Pursglove: Velocity, the Need for Speed - epicenter 2010
20 x Tips to better Optimize your Flash content
ConFoo 2016: Development to Deployment
Silverlight vs HTML5 - Lessons learned from the real world...
FuelPHP - a PHP HMVC Framework by silicongulf.com
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
Building Rackspace Cloud Monitoring
5 Arguments Against Kanban
Web and App Performance: Top Problems to avoid to keep you out of the News
Introduction to Progressive Web Apps / Meet Magento PL 2018
Http/2 - What's it all about?
Adopting Fortune 500 Scaling Tactics from Day One.pdf
ColdFusion Summit 2016 - Bringing Order to the Chaos: Take the MVC Plunge
Bring Order to the Chaos: Take the MVC Plunge
A Dive Into Containers and Docker
Ad

More from Magnolia (20)

PDF
The SEO Workflow
PPTX
Magnolia 6 release walkthrough
PDF
Buzzword bingo: The real deal behind omnichannel, personalization and headless
PDF
Developing Magnolia based sites correctly, quickly and efficiently
PDF
Integrating e-Commerce into your Customer Experience
PDF
Customer Engagement in the Digital Era
PDF
The Age of the IOT & Digital Business
PDF
Using Magnolia in a Microservices Architecture
PDF
A modern front end development workflow for Magnolia at Atlassian
PDF
Magnolia Conference 2015 - Pascal Mangold's keynote
PDF
Product keynote - introducing Magnolia 5.4
PDF
Launching Magnolia on demand
PDF
Front-end developers - build Magnolia sites faster
PDF
Magnolia and beacons: how do they work best together?
PDF
Magnolia and the IOT
PDF
Internationalization for globalized enterprise websites
PDF
Solving for complex UI designs: a front-end perspective and approach
PDF
Extending Magnolia with our solutions
PDF
Boost your online e commerce with magnolia
PDF
The slick YAML based configuration by file in Magnolia 5.4
The SEO Workflow
Magnolia 6 release walkthrough
Buzzword bingo: The real deal behind omnichannel, personalization and headless
Developing Magnolia based sites correctly, quickly and efficiently
Integrating e-Commerce into your Customer Experience
Customer Engagement in the Digital Era
The Age of the IOT & Digital Business
Using Magnolia in a Microservices Architecture
A modern front end development workflow for Magnolia at Atlassian
Magnolia Conference 2015 - Pascal Mangold's keynote
Product keynote - introducing Magnolia 5.4
Launching Magnolia on demand
Front-end developers - build Magnolia sites faster
Magnolia and beacons: how do they work best together?
Magnolia and the IOT
Internationalization for globalized enterprise websites
Solving for complex UI designs: a front-end perspective and approach
Extending Magnolia with our solutions
Boost your online e commerce with magnolia
The slick YAML based configuration by file in Magnolia 5.4
Ad

Recently uploaded (20)

PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
assetexplorer- product-overview - presentation
PDF
Time Tracking Features That Teams and Organizations Actually Need
PPTX
Trending Python Topics for Data Visualization in 2025
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Website Design Services for Small Businesses.pdf
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Types of Token_ From Utility to Security.pdf
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
Cost to Outsource Software Development in 2025
PPTX
GSA Content Generator Crack (2025 Latest)
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Computer Software and OS of computer science of grade 11.pptx
Patient Appointment Booking in Odoo with online payment
assetexplorer- product-overview - presentation
Time Tracking Features That Teams and Organizations Actually Need
Trending Python Topics for Data Visualization in 2025
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Wondershare Recoverit Full Crack New Version (Latest 2025)
MCP Security Tutorial - Beginner to Advanced
Website Design Services for Small Businesses.pdf
Digital Systems & Binary Numbers (comprehensive )
Types of Token_ From Utility to Security.pdf
"Secure File Sharing Solutions on AWS".pptx
Autodesk AutoCAD Crack Free Download 2025
Salesforce Agentforce AI Implementation.pdf
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Cost to Outsource Software Development in 2025
GSA Content Generator Crack (2025 Latest)
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency

Dynamic page caching for Magnolia 5.4