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?

More Related Content

PDF
Drupalcon 2021 - Nuxt.js for drupal developers
PPTX
Decoupled drupal + vue.js
PDF
Decoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
PDF
Getting started with the Lupus Nuxt.js Drupal Stack
PPTX
An Overview on Nuxt.js
PPTX
Bundling your front-end with Webpack
PDF
Docker Up and Running for Web Developers
PDF
Introduction to VueJS & Vuex
Drupalcon 2021 - Nuxt.js for drupal developers
Decoupled drupal + vue.js
Decoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
Getting started with the Lupus Nuxt.js Drupal Stack
An Overview on Nuxt.js
Bundling your front-end with Webpack
Docker Up and Running for Web Developers
Introduction to VueJS & Vuex

What's hot (20)

PDF
Nuxt.JS Introdruction
PPTX
Vue js for beginner
PDF
Javascript ui for rest services
PDF
Vue.js
PDF
PyConFR 2014 - DEPOT, Story of a file.write() gone wrong
PDF
EP2016 - Moving Away From Nodejs To A Pure Python Solution For Assets
PDF
AngularJS Deep Dives (NYC GDG Apr 2013)
PDF
Intro to sbt-web
ODP
An Introduction to Vuejs
PPTX
Vue Introduction
ODP
Basics of VueJS
PPTX
VueJs Workshop
PDF
Vue 淺談前端建置工具
PDF
Intro to Vue
PDF
Java2day 2013 : Modern workflows for javascript integration
PDF
第一次用 Vue.js 就愛上 [改]
PDF
Kickstarting Node.js Projects with Yeoman
PPT
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
PDF
VueJS Introduction
Nuxt.JS Introdruction
Vue js for beginner
Javascript ui for rest services
Vue.js
PyConFR 2014 - DEPOT, Story of a file.write() gone wrong
EP2016 - Moving Away From Nodejs To A Pure Python Solution For Assets
AngularJS Deep Dives (NYC GDG Apr 2013)
Intro to sbt-web
An Introduction to Vuejs
Vue Introduction
Basics of VueJS
VueJs Workshop
Vue 淺談前端建置工具
Intro to Vue
Java2day 2013 : Modern workflows for javascript integration
第一次用 Vue.js 就愛上 [改]
Kickstarting Node.js Projects with Yeoman
The MEAN Stack: MongoDB, ExpressJS, AngularJS and Node.js
VueJS Introduction
Ad

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

PDF
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
PDF
JEE Conf 2015: Less JS!
PDF
JAMstack with gatsby, contentful and netlify aka the dream stack
PDF
PPTX
Web component
PPTX
Developing JavaScript Widgets
PDF
Seo for single page applications
PDF
Pagespeed what, why, and how it works
PPTX
Developing JavaScript Widgets
PPTX
Basics of Vue.js 2019
PPTX
Headless CMS for Magento using Hyvä and Storyblok
PDF
Web App Prototypes with Google App Engine
PPTX
How NOT to get lost in the current JavaScript landscape
PPTX
From React to React Native - Things I wish I knew when I started
PDF
20 tips for website performance
PDF
Code driven development in drupal
PPTX
Introduction to Vue.js DevStaff Meetup 13.02
PPTX
Refactoring to a SPA
PDF
Performance (browser)
PDF
Refactoring to a Single Page Application
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
JEE Conf 2015: Less JS!
JAMstack with gatsby, contentful and netlify aka the dream stack
Web component
Developing JavaScript Widgets
Seo for single page applications
Pagespeed what, why, and how it works
Developing JavaScript Widgets
Basics of Vue.js 2019
Headless CMS for Magento using Hyvä and Storyblok
Web App Prototypes with Google App Engine
How NOT to get lost in the current JavaScript landscape
From React to React Native - Things I wish I knew when I started
20 tips for website performance
Code driven development in drupal
Introduction to Vue.js DevStaff Meetup 13.02
Refactoring to a SPA
Performance (browser)
Refactoring to a Single Page Application
Ad

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
A Presentation on Artificial Intelligence
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
NewMind AI Monthly Chronicles - July 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Digital-Transformation-Roadmap-for-Companies.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
“AI and Expert System Decision Support & Business Intelligence Systems”
A Presentation on Artificial Intelligence
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology

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