SlideShare a Scribd company logo
Pre rendering media sites with nuxt.js & netlify
by Wolfgang Ziegler // fago
Pre-Rendering Media Sites with
Nuxt.js & Netlify

Wolfgang Ziegler // fago

Twitter: @the_real_fago

Core contributions:
 Drupal 8 Entity API & Typed Data API

Contrib:
 Rules, Entity API, Field Collection, Profile2

CEO / CTO of drunomics GmbH
About me
What‘s pre-rendering
Data source (e.g. Drupal)
+
Pre-render process
=
Static files
(.html, .css, .js, ..)
Why to pre-render?
●
Performance – static sites are fast!
●
Easy way to decouple
- without SEO concerns
- while keeping hosting cost &
complexity down!
The progressive Vue.js framework!
http://nuxtjs.org
Why Vue.js?
●
Approachable
– Tries to stick HTML , JavaScript, CSS standards
– Great documentation!
●
Versatile
– easy to get started
– incrementally adoptable (router, store, …)!
●
Performant!
– 20kB gzipped, Virtual DOM
●
follows Vue.js principles
●
includes all needed for fully-fledged applications
– Transpilation, CSS (Pre-)Processors
– Routes, with automatic code splitting, ...
●
Modular (PWA, Axios, ...)
●
Performant & Enjoyable
Nuxt.js Rendering
●
Single Page Application (SPA)
– Small initial page → JavasScript + APIs
●
Server Side Rendered
– „universal“ or „isomorphic“ mode
●
Statically generated
– It‘s pre-rendered – no need for a server!
– Can be combined with API requests
Netlify
●
All-in-one (hosting) platform for static
sites
●
Automatic deployment after Git
commits
●
Builds your app per branch / PR
●
Atomic deployments, SSL, automatically
managed CDN, free tier
Netlify + Nuxt.js
●
npx create-nuxt-app ams-demo
●
Push to Github
●
Log into netlify.com and connect it
●
Configure build command:
npm run generate
●
Deploy!
Results...
●
https://github.com/fago/nuxt-netlify-ams
→ Build time: 50s. Total deploy time: 50s
https://5db7774547e9e00008f5f780--
pensive-goldberg-02ea42.netlify.com/
Great setup for serving content
●
Drupal serves as editoral application
●
After changes, the Netlify builds gets
triggered! (via API)
●
Deployment happens fully-automated!
●
Fast and reliable CDN powered site!
… but how do you
●
deal with instant updates?
●
handle large amounts of content?
●
handle personalized content?
Personalization via API
●
Have a general pre-rendered site
●
Login via API
●
Fetch personalized data via API
●
Let Vue.js handle DOM updates
Instant updates
●
Regularly pre-generating static sites!
●
but still…
pre-rendered pages might be not fresh
enough!
●
Use APIs to fetch latest updates!
→ Apply changes via Vue.js
Massive amount of content
●
Pre-rendering huge amount of content and
pages takes time!
~12.000 pages takes about 20min!
●
Incremental pre-rendering is not there!
●
Thus: Pre-render parts & deliver main
content via Drupal
Pre-render the page shell
+ Main content
=
Pre-rendered content
Dynamic content
Pre-rendered page Drupal provided
content
Complete page
So rendering on the backend again?
●
Only render simplified markup using
„Custom Elements“
●
Render custom elements client-side with Vue.js!
<pg-quote>
<p>Rendering custom elements is as easy as pie!</p>
<span slot="author">fago</span>
</pg-quote>
<pg-twitter src="#the-twitter-post-link">
<h3 slot="title">The title value</h3>
</pg-twitter>
Lupus Decoupled Drupal
Pre-render the page shell
+ Main content
=
Pre-rendered content
Dynamic content
Pre-rendered page Drupal provided
content
Complete page
Frontproxy: Pre-build page response
●
Make Drupal provide the main content via API
+ needed page metadata via API
●
Handle requests by
– fetching pre-generated page shell
– Main content from API
●
Form-submissions, sessions etc. all working as
usual!
●
github.com/drunomics/lupus-frontproxy
Frontproxy + API backend
example.com/{ path }
static.example.com/layout
—default.html
example.com/api/{ path}
Cookies,
Form-data,
...
Lupus CE Renderer module
●
Switches main content renderer to deliver it
via API
●
Only handles main content – no block layout!
●
Adds page metadata (title, breadcrumbs,
metatags)
●
https://drupal.org/project/lupus_ce_renderer
Client-side route changes!
●
First page request → Handled by the
frontproxy!
●
Subsequent page requests:
– Client-side application fetches main content from
API
– Apply changes (Page content, Page metadata)
→ Better UX and performance by avoiding
full page reloads!
Custom Elements
●
Enable client-side rendering via Vue.js /
Web / or React components
●
SEO-friendly without pre-rendering:
– HTML responses with regular content in slots!
– Custom Elements are standardized by the
W3C as part of the web components spec
●
Simplified and more semantic markup!
Custom Elements & SEO
●
render essential data with standard HTML
tags and attribtues
●
Keep links between your pages!
<a is="teaser-wide" href="/your-article">
<h2 slot="title">Article title</h2>
<div slot="excerpt">Some excerpt....</div>
</a>
Custom elements module
●
Renders entities into Custom Element
markup
●
Comes with „Custom elements everywhere“
●
Provides a Symfony Serializer-like API
generating Custom Elements markup
●
Layout-builder compatible
●
https://drupal.org/project/custom_elements
A novel approach to
progressively decoupled Drupal
●
Decouples frontend rendering from the
backend!
●
Backend stays in control of routing &
URLs,
form processing, sessions, …
●
Easy caching & scalability at the backend!
→ Cache your API requests!
Conclusions
●
Advantages of decoupled frontend!
●
Editors & site managers stay in control!
●
Performance – less issues with cache tags!
●
No Node.js hosting required
●
Con: Team needs to understand it!
Nuxt.js rendering options!
Option to turn on Nuxt.js SSR and replace
the frontproxy!
●
Still easy to scale (but cache page shell?)
●
Less worrying about SEO friendly markup
●
One more service to run & pay hosting
cost
Thank you
Join us for
contribution opportunities
Thursday, October 31, 2019
9:00-18:00
Room: Europe Foyer 2
Mentored
Contribution
First Time
Contributor Workshop
General
Contribution
#DrupalContributions
9:00-14:00
Room: Diamond Lounge
9:00-18:00
Room: Europe Foyer 2
What did you think?
Locate this session at the DrupalCon Amsterdam website:
https://drupal.kuoni-congress.info/2019/program/
Take the Survey!
https://www.surveymonkey.com/r/DrupalConAmsterdam
Questions?
Ad

More Related Content

What's hot (20)

Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
David Ličen
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
Chandrasekar G
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
Ioan Eugen Stan
 
Vue.js
Vue.jsVue.js
Vue.js
BADR
 
PyConFR 2014 - DEPOT, Story of a file.write() gone wrong
PyConFR 2014 - DEPOT, Story of a file.write() gone wrongPyConFR 2014 - DEPOT, Story of a file.write() gone wrong
PyConFR 2014 - DEPOT, Story of a file.write() gone wrong
Alessandro Molina
 
EP2016 - Moving Away From Nodejs To A Pure Python Solution For Assets
EP2016 - Moving Away From Nodejs To A Pure Python Solution For AssetsEP2016 - Moving Away From Nodejs To A Pure Python Solution For Assets
EP2016 - Moving Away From Nodejs To A Pure Python Solution For Assets
Alessandro Molina
 
AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)
Nitya Narasimhan
 
Intro to sbt-web
Intro to sbt-webIntro to sbt-web
Intro to sbt-web
Marius Soutier
 
Vuejs
VuejsVuejs
Vuejs
Mario Alexandro Santini
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
Paddy Lock
 
Vue Introduction
Vue IntroductionVue Introduction
Vue Introduction
Elad Gasner
 
Basics of VueJS
Basics of VueJSBasics of VueJS
Basics of VueJS
Squash Apps Pvt Ltd
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs Workshop
Unfold UI
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
andyyou
 
Intro to Vue
Intro to Vue Intro to Vue
Intro to Vue
Isatu Conteh
 
Java2day 2013 : Modern workflows for javascript integration
Java2day 2013 : Modern workflows for javascript integrationJava2day 2013 : Modern workflows for javascript integration
Java2day 2013 : Modern workflows for javascript integration
Mite Mitreski
 
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]
Kuro Hsu
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
MongoDB
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
David Ličen
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
David Ličen
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
Ioan Eugen Stan
 
Vue.js
Vue.jsVue.js
Vue.js
BADR
 
PyConFR 2014 - DEPOT, Story of a file.write() gone wrong
PyConFR 2014 - DEPOT, Story of a file.write() gone wrongPyConFR 2014 - DEPOT, Story of a file.write() gone wrong
PyConFR 2014 - DEPOT, Story of a file.write() gone wrong
Alessandro Molina
 
EP2016 - Moving Away From Nodejs To A Pure Python Solution For Assets
EP2016 - Moving Away From Nodejs To A Pure Python Solution For AssetsEP2016 - Moving Away From Nodejs To A Pure Python Solution For Assets
EP2016 - Moving Away From Nodejs To A Pure Python Solution For Assets
Alessandro Molina
 
AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)AngularJS Deep Dives (NYC GDG Apr 2013)
AngularJS Deep Dives (NYC GDG Apr 2013)
Nitya Narasimhan
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
Paddy Lock
 
Vue Introduction
Vue IntroductionVue Introduction
Vue Introduction
Elad Gasner
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs Workshop
Unfold UI
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
andyyou
 
Java2day 2013 : Modern workflows for javascript integration
Java2day 2013 : Modern workflows for javascript integrationJava2day 2013 : Modern workflows for javascript integration
Java2day 2013 : Modern workflows for javascript integration
Mite Mitreski
 
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]
Kuro Hsu
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.jsThe MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
MongoDB
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
David Ličen
 

Similar to Pre rendering media sites with nuxt.js & netlify (20)

Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
David Amend
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!
_Dewy_
 
JAMstack with gatsby, contentful and netlify aka the dream stack
JAMstack with gatsby, contentful and netlify aka the dream stackJAMstack with gatsby, contentful and netlify aka the dream stack
JAMstack with gatsby, contentful and netlify aka the dream stack
zonathen
 
Dust.js
Dust.jsDust.js
Dust.js
Yevgeniy Brikman
 
Web component
Web componentWeb component
Web component
EngrHasanuzzamanSumo
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript Widgets
Bob German
 
Seo for single page applications
Seo for single page applicationsSeo for single page applications
Seo for single page applications
JustinGillespie12
 
Pagespeed what, why, and how it works
Pagespeed   what, why, and how it worksPagespeed   what, why, and how it works
Pagespeed what, why, and how it works
Ilya Grigorik
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript Widgets
Bob German
 
Basics of Vue.js 2019
Basics of Vue.js 2019Basics of Vue.js 2019
Basics of Vue.js 2019
Paul Bele
 
Headless CMS for Magento using Hyvä and Storyblok
Headless CMS for Magento using Hyvä and StoryblokHeadless CMS for Magento using Hyvä and Storyblok
Headless CMS for Magento using Hyvä and Storyblok
Matthias Glitzner-Zeis
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App Engine
Vlad Filippov
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
Radosław Scheibinger
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
sparkfabrik
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
Andrew Siemer
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupal
Andriy Yun
 
Introduction to Vue.js DevStaff Meetup 13.02
Introduction to Vue.js  DevStaff Meetup 13.02Introduction to Vue.js  DevStaff Meetup 13.02
Introduction to Vue.js DevStaff Meetup 13.02
Paul Bele
 
Refactoring to a SPA
Refactoring to a SPARefactoring to a SPA
Refactoring to a SPA
Marcello Teodori
 
Performance (browser)
Performance (browser)Performance (browser)
Performance (browser)
aquarius070287
 
Refactoring to a Single Page Application
Refactoring to a Single Page ApplicationRefactoring to a Single Page Application
Refactoring to a Single Page Application
Codemotion
 
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
David Amend
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!
_Dewy_
 
JAMstack with gatsby, contentful and netlify aka the dream stack
JAMstack with gatsby, contentful and netlify aka the dream stackJAMstack with gatsby, contentful and netlify aka the dream stack
JAMstack with gatsby, contentful and netlify aka the dream stack
zonathen
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript Widgets
Bob German
 
Seo for single page applications
Seo for single page applicationsSeo for single page applications
Seo for single page applications
JustinGillespie12
 
Pagespeed what, why, and how it works
Pagespeed   what, why, and how it worksPagespeed   what, why, and how it works
Pagespeed what, why, and how it works
Ilya Grigorik
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript Widgets
Bob German
 
Basics of Vue.js 2019
Basics of Vue.js 2019Basics of Vue.js 2019
Basics of Vue.js 2019
Paul Bele
 
Headless CMS for Magento using Hyvä and Storyblok
Headless CMS for Magento using Hyvä and StoryblokHeadless CMS for Magento using Hyvä and Storyblok
Headless CMS for Magento using Hyvä and Storyblok
Matthias Glitzner-Zeis
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App Engine
Vlad Filippov
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
Radosław Scheibinger
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
sparkfabrik
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
Andrew Siemer
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupal
Andriy Yun
 
Introduction to Vue.js DevStaff Meetup 13.02
Introduction to Vue.js  DevStaff Meetup 13.02Introduction to Vue.js  DevStaff Meetup 13.02
Introduction to Vue.js DevStaff Meetup 13.02
Paul Bele
 
Refactoring to a Single Page Application
Refactoring to a Single Page ApplicationRefactoring to a Single Page Application
Refactoring to a Single Page Application
Codemotion
 
Ad

Recently uploaded (20)

Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Ad

Pre rendering media sites with nuxt.js & netlify

  • 2. by Wolfgang Ziegler // fago Pre-Rendering Media Sites with Nuxt.js & Netlify
  • 3.  Wolfgang Ziegler // fago  Twitter: @the_real_fago  Core contributions:  Drupal 8 Entity API & Typed Data API  Contrib:  Rules, Entity API, Field Collection, Profile2  CEO / CTO of drunomics GmbH About me
  • 4. What‘s pre-rendering Data source (e.g. Drupal) + Pre-render process = Static files (.html, .css, .js, ..)
  • 5. Why to pre-render? ● Performance – static sites are fast! ● Easy way to decouple - without SEO concerns - while keeping hosting cost & complexity down!
  • 6. The progressive Vue.js framework! http://nuxtjs.org
  • 7. Why Vue.js? ● Approachable – Tries to stick HTML , JavaScript, CSS standards – Great documentation! ● Versatile – easy to get started – incrementally adoptable (router, store, …)! ● Performant! – 20kB gzipped, Virtual DOM
  • 8. ● follows Vue.js principles ● includes all needed for fully-fledged applications – Transpilation, CSS (Pre-)Processors – Routes, with automatic code splitting, ... ● Modular (PWA, Axios, ...) ● Performant & Enjoyable
  • 9. Nuxt.js Rendering ● Single Page Application (SPA) – Small initial page → JavasScript + APIs ● Server Side Rendered – „universal“ or „isomorphic“ mode ● Statically generated – It‘s pre-rendered – no need for a server! – Can be combined with API requests
  • 10. Netlify ● All-in-one (hosting) platform for static sites ● Automatic deployment after Git commits ● Builds your app per branch / PR ● Atomic deployments, SSL, automatically managed CDN, free tier
  • 11. Netlify + Nuxt.js ● npx create-nuxt-app ams-demo ● Push to Github ● Log into netlify.com and connect it ● Configure build command: npm run generate ● Deploy!
  • 12. Results... ● https://github.com/fago/nuxt-netlify-ams → Build time: 50s. Total deploy time: 50s https://5db7774547e9e00008f5f780-- pensive-goldberg-02ea42.netlify.com/
  • 13. Great setup for serving content ● Drupal serves as editoral application ● After changes, the Netlify builds gets triggered! (via API) ● Deployment happens fully-automated! ● Fast and reliable CDN powered site!
  • 14. … but how do you ● deal with instant updates? ● handle large amounts of content? ● handle personalized content?
  • 15. Personalization via API ● Have a general pre-rendered site ● Login via API ● Fetch personalized data via API ● Let Vue.js handle DOM updates
  • 16. Instant updates ● Regularly pre-generating static sites! ● but still… pre-rendered pages might be not fresh enough! ● Use APIs to fetch latest updates! → Apply changes via Vue.js
  • 17. Massive amount of content ● Pre-rendering huge amount of content and pages takes time! ~12.000 pages takes about 20min! ● Incremental pre-rendering is not there! ● Thus: Pre-render parts & deliver main content via Drupal
  • 18. Pre-render the page shell + Main content = Pre-rendered content Dynamic content Pre-rendered page Drupal provided content Complete page
  • 19. So rendering on the backend again? ● Only render simplified markup using „Custom Elements“ ● Render custom elements client-side with Vue.js! <pg-quote> <p>Rendering custom elements is as easy as pie!</p> <span slot="author">fago</span> </pg-quote> <pg-twitter src="#the-twitter-post-link"> <h3 slot="title">The title value</h3> </pg-twitter>
  • 21. Pre-render the page shell + Main content = Pre-rendered content Dynamic content Pre-rendered page Drupal provided content Complete page
  • 22. Frontproxy: Pre-build page response ● Make Drupal provide the main content via API + needed page metadata via API ● Handle requests by – fetching pre-generated page shell – Main content from API ● Form-submissions, sessions etc. all working as usual! ● github.com/drunomics/lupus-frontproxy
  • 23. Frontproxy + API backend example.com/{ path } static.example.com/layout —default.html example.com/api/{ path} Cookies, Form-data, ...
  • 24. Lupus CE Renderer module ● Switches main content renderer to deliver it via API ● Only handles main content – no block layout! ● Adds page metadata (title, breadcrumbs, metatags) ● https://drupal.org/project/lupus_ce_renderer
  • 25. Client-side route changes! ● First page request → Handled by the frontproxy! ● Subsequent page requests: – Client-side application fetches main content from API – Apply changes (Page content, Page metadata) → Better UX and performance by avoiding full page reloads!
  • 26. Custom Elements ● Enable client-side rendering via Vue.js / Web / or React components ● SEO-friendly without pre-rendering: – HTML responses with regular content in slots! – Custom Elements are standardized by the W3C as part of the web components spec ● Simplified and more semantic markup!
  • 27. Custom Elements & SEO ● render essential data with standard HTML tags and attribtues ● Keep links between your pages! <a is="teaser-wide" href="/your-article"> <h2 slot="title">Article title</h2> <div slot="excerpt">Some excerpt....</div> </a>
  • 28. Custom elements module ● Renders entities into Custom Element markup ● Comes with „Custom elements everywhere“ ● Provides a Symfony Serializer-like API generating Custom Elements markup ● Layout-builder compatible ● https://drupal.org/project/custom_elements
  • 29. A novel approach to progressively decoupled Drupal ● Decouples frontend rendering from the backend! ● Backend stays in control of routing & URLs, form processing, sessions, … ● Easy caching & scalability at the backend! → Cache your API requests!
  • 30. Conclusions ● Advantages of decoupled frontend! ● Editors & site managers stay in control! ● Performance – less issues with cache tags! ● No Node.js hosting required ● Con: Team needs to understand it!
  • 31. Nuxt.js rendering options! Option to turn on Nuxt.js SSR and replace the frontproxy! ● Still easy to scale (but cache page shell?) ● Less worrying about SEO friendly markup ● One more service to run & pay hosting cost
  • 33. Join us for contribution opportunities Thursday, October 31, 2019 9:00-18:00 Room: Europe Foyer 2 Mentored Contribution First Time Contributor Workshop General Contribution #DrupalContributions 9:00-14:00 Room: Diamond Lounge 9:00-18:00 Room: Europe Foyer 2
  • 34. What did you think? Locate this session at the DrupalCon Amsterdam website: https://drupal.kuoni-congress.info/2019/program/ Take the Survey! https://www.surveymonkey.com/r/DrupalConAmsterdam