SlideShare a Scribd company logo
Navigating the Critical Rendering Path
Jamie Alberico | @Jammer_Volts
This talk is for you if:
● Your site has been switched to mobile first index
● Your site uses JavaScript
● Performance is a ranking factor for your site
● You’d like users to convert
This talk is from me if:
● I’m Jamie Alberico
● I’m Not a Robot (but I speak bot)
● I’m notorious for blue hair & tech SEO
● You wanna play D&D sometime
What we'll cover today
What is
CRP?
How to
measure
CRP
Optimizing
CRP
What is the Critical
Rendering Path?
BE GONE
SCARY
TECHNICAL
WORDS!
The Critical Rendering Path is the steps a
browser has to take to get the content a user has
asked for on the screen.
Basically we’re talking about our already beloved
Above the Fold content.
User Screen Content
It’s a simple formula
What we think it’ll be like.
What it’s actually like.
Let’s Build It!
1. Document Object Model(DOM)
2. CSS object model(CSSOM)
3. Render Tree
4. Layout
5. Paint.
DOM
HTML
HTML
Parser
DOM
Tree
Step 1: Document
Object Model(DOM)
Output
DOM
HTML
Style
Sheets
HTML
Parser
CSS
Parser
DOM
Tree
Style
Rules
Attachment
Step 2: CSS object
model(CSSOM)
Output
Step 3: Render TreeDOM
HTML
Style
Sheets
HTML
Parser
CSS
Parser
DOM
Tree
Style
Rules
Render
Tree
Attachment
Output
DOM
HTML
Style
Sheets
HTML
Parser
CSS
Parser
DOM
Tree
Style
Rules
Render
Tree
Attachment
Layout
Step 4: Layout
Painting
DOM
HTML
Style
Sheets
HTML
Parser
CSS
Parser
DOM
Tree
Style
Rules
Render
Tree
Attachment
Layout
Step 5: Paint
Oi, Jamie! What about JavaScript? Where’s it go?
all around us.
DOM
HTML
Style
Sheets
HTML
Parser
CSS
Parser
DOM
Tree
Style
Rules
Render
Tree
Attachment
Layout
Painting
TTFB
First
Contentful
Paint
How to measure
the Critical
Rendering Path
Pros
● No dev work
● Tracks changes
● No worrying about extensions or
stored
● Save results as json or html
Cons
● Testing one page at a time
Option 1: Web.dev
Pros
● Automation is cool
● More tests = more data
● Store results and visualize changes
● Test lower environments
Cons
● Dev work required
● Dedicated space required
Option 2: Automate with Lighthouse
Pros
● Captures and records real-world
CRP performance of any page(!!)
● Holy heck that’s beautiful.
Cons
● Must be implemented into your
code base (devs required)
● Must be added to each page type
Option 3: Navigation Timing
API
CRP Milestones from the Navigation API
● domInteractive marks when DOM is ready.
● domContentLoaded typically marks when both the DOM and CSSOM are
ready.
● If there is no parser blocking JavaScript then DOMContentLoaded will fire
immediately after domInteractive.
● domComplete marks when the page and all of its subresources are ready.
Optimizing the
Critical Rendering
Path
Don’t. Block. Rendering.
3 types of rendering-blocking resources
A <script> tag that:
● Is in the <head> of the document.
● Does not have a defer attribute.
● Does not have an async attribute.
Don’t. Block. Rendering.
3 types of rendering-blocking resources
A <link rel="stylesheet"> tag that:
● Does not have a disabled attribute. When this attribute is present, the
browser does not download the stylesheet.
● Does not have a media attribute that matches the user's device.
Don’t. Block. Rendering.
A <link rel="import"> tag that:
● Does not have an async attribute.
Protect the <head>
● Remove synchronous 3rd party JavaScript, CSS or fonts from inside the
HTML <head>. These are a Single Point of Failure.
● iFrames will prematurely close the <head>. Any resources or metadata listed
after the iframe in <head> won’t be executed or discovered.
Keep resources small
● Use minification and data compression to make scripts as small as possible
● If your script is larger than 50–100 kB, split it up into separate smaller
bundles.
● Multiple smaller bundles are more effective than a single large script
package.
● If your site uses HTTP/2 multiplexing, multiple requests and responses can
be in flight at the same time.
Avoid critical request chains
This is a visualization of all the requests to build
a page.
Our site
3rd party
script
Script’s
script
Script’s
script’s
script
All the
pretty
icons
and
stuff.
Load only what your need
● If we want to load a URL within 5 seconds on a fast 3G connection (~ 1.6
Mbps) we have about 1000KB budget for ALL of our content.
● Every script called has to be downloaded, parsed, compiled, and executed–
regardless of whether it contributes to the content of the page.
● If you need it, only download it once.
● Reuse it as long as possible.
Prioritize what you load when
Inline CSS for above the fold content
By default, all CSS is a blocking resource
● Inline CSS for content in the initial load viewport is loaded in head
● This CSS should appear before you make calls for external style sheets or JS
● Extended max-age is used on JS and CSS resources
● Each resource should specify an explicit caching policy that answers the
following questions: whether the resource can be cached and by whom, for
how long, and if applicable, how it can be efficiently revalidated when the
caching policy expires.
Cache JS and CSS resources as long as possible
Cache JS and CSS resources as long as possible
● When the server returns a response it must provide the Cache-Control and
ETag headers:
○ Cache-Control defines how, and for how long the individual response can be cached by the
browser and other intermediate caches.
○ ETag provides a revalidation token that is automatically sent by the browser to check if the
resource has changed since the last time it was requested.
|-------------|
| MAKE |
| ALLIES |
|-------------|
(__/) ||
(•ㅅ•) ||
/   づ

More Related Content

What's hot

What's hot (20)

Tech SEO + Site Migrations - SMX Munich
Tech SEO + Site Migrations - SMX MunichTech SEO + Site Migrations - SMX Munich
Tech SEO + Site Migrations - SMX Munich
 
Optimizing for Mobile First Index
Optimizing for Mobile First IndexOptimizing for Mobile First Index
Optimizing for Mobile First Index
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
 
Challenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceChallenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering service
 
Brighton SEO July 2021 How JavaScript is preventing you from passing Core W...
Brighton SEO July 2021   How JavaScript is preventing you from passing Core W...Brighton SEO July 2021   How JavaScript is preventing you from passing Core W...
Brighton SEO July 2021 How JavaScript is preventing you from passing Core W...
 
The New Renaissance of JavaScript
The New Renaissance of JavaScriptThe New Renaissance of JavaScript
The New Renaissance of JavaScript
 
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The EdgeBrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
 
SEO vs Angular
SEO vs AngularSEO vs Angular
SEO vs Angular
 
Headless SEO: Optimising Next Gen Sites | brightonSEO 2021
Headless SEO: Optimising Next Gen Sites | brightonSEO 2021Headless SEO: Optimising Next Gen Sites | brightonSEO 2021
Headless SEO: Optimising Next Gen Sites | brightonSEO 2021
 
Hey Googlebot, did you cache that ?
Hey Googlebot, did you cache that ?Hey Googlebot, did you cache that ?
Hey Googlebot, did you cache that ?
 
Crafting Expertise, Authority and Trust with Entity-Based Content Strategy - ...
Crafting Expertise, Authority and Trust with Entity-Based Content Strategy - ...Crafting Expertise, Authority and Trust with Entity-Based Content Strategy - ...
Crafting Expertise, Authority and Trust with Entity-Based Content Strategy - ...
 
Automating Google Lighthouse
Automating Google LighthouseAutomating Google Lighthouse
Automating Google Lighthouse
 
Accelerated Mobile - Beyond AMP
Accelerated Mobile - Beyond AMPAccelerated Mobile - Beyond AMP
Accelerated Mobile - Beyond AMP
 
TechSEO Boost 2018: Implementing Hreflang on Legacy Tech Stacks Using Service...
TechSEO Boost 2018: Implementing Hreflang on Legacy Tech Stacks Using Service...TechSEO Boost 2018: Implementing Hreflang on Legacy Tech Stacks Using Service...
TechSEO Boost 2018: Implementing Hreflang on Legacy Tech Stacks Using Service...
 
Dynamic Rendering - is this really an SEO silver bullet? SMX WEST
Dynamic Rendering - is this really an SEO silver bullet? SMX WESTDynamic Rendering - is this really an SEO silver bullet? SMX WEST
Dynamic Rendering - is this really an SEO silver bullet? SMX WEST
 
Debugging rendering problems at scale
Debugging rendering problems at scaleDebugging rendering problems at scale
Debugging rendering problems at scale
 
The State of the Web: Pagination and Infinite Scroll
The State of the Web: Pagination and Infinite ScrollThe State of the Web: Pagination and Infinite Scroll
The State of the Web: Pagination and Infinite Scroll
 
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry White
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry WhiteGTM Clowns, fun and hacks - Search Elite - May 2017 Gerry White
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry White
 
SEO for Angular - BrightonSEO 2018
SEO for Angular - BrightonSEO 2018SEO for Angular - BrightonSEO 2018
SEO for Angular - BrightonSEO 2018
 
AMP - SMX München 2018
AMP - SMX München 2018AMP - SMX München 2018
AMP - SMX München 2018
 

Similar to Navigating the critical rendering path - Jamie Alberico - VirtuaCon

Similar to Navigating the critical rendering path - Jamie Alberico - VirtuaCon (20)

Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)Understanding Page Load / Ziling Zhao (Google)
Understanding Page Load / Ziling Zhao (Google)
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 
Exploring Critical Rendering Path
Exploring Critical Rendering PathExploring Critical Rendering Path
Exploring Critical Rendering Path
 
Frontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser renderingFrontend Performance: Illusions & browser rendering
Frontend Performance: Illusions & browser rendering
 
The latest in site speed: advanced #webperf 2018
The latest in site speed: advanced #webperf 2018The latest in site speed: advanced #webperf 2018
The latest in site speed: advanced #webperf 2018
 
implement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflowimplement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflow
 
Javascript & SEO 2019
Javascript & SEO 2019Javascript & SEO 2019
Javascript & SEO 2019
 
Word press optimizations
Word press optimizations Word press optimizations
Word press optimizations
 
Neoito — How modern browsers work
Neoito — How modern browsers workNeoito — How modern browsers work
Neoito — How modern browsers work
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slow
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web Apps
 
Vlad zelinschi optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering pathVlad zelinschi   optimizing the critical rendering path
Vlad zelinschi optimizing the critical rendering path
 
How fast is fast enough - SMX West 2018
How fast is fast enough - SMX West 2018How fast is fast enough - SMX West 2018
How fast is fast enough - SMX West 2018
 
Html from request to rendering
Html from request to renderingHtml from request to rendering
Html from request to rendering
 
9 Useful Things that Every Web Developer Needs to Know
9 Useful Things that Every Web Developer Needs to Know9 Useful Things that Every Web Developer Needs to Know
9 Useful Things that Every Web Developer Needs to Know
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)
 
Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21
 
Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...
 
Dust.js
Dust.jsDust.js
Dust.js
 
Rendering: Or why your perfectly optimized content doesn't rank
Rendering: Or why your perfectly optimized content doesn't rankRendering: Or why your perfectly optimized content doesn't rank
Rendering: Or why your perfectly optimized content doesn't rank
 

Recently uploaded

Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
abhinandnam9997
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
aagad
 

Recently uploaded (12)

The Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI StudioThe Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI Studio
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
 

Navigating the critical rendering path - Jamie Alberico - VirtuaCon