Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Css Critical Path
Search
Valerio Sillari
October 13, 2017
Technology
43
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Css Critical Path
Some info about what I got about Critical Path, and some tools and ideas how to solve it
Valerio Sillari
October 13, 2017
Other Decks in Technology
See All in Technology
#jawssonic2026 あの時代が悪かった ~動かなかったSageMakerと共に迎えたイベント当日~
ktkn1129
0
130
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
240
多摩川(.dev)ランニング入門 / Tamagawa.dev#3
fujiwara3
3
390
AI時代のAPI品質を支えるガードレール / API Guardrails for API quality in the AI era
yokawasa
1
140
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
150
コスト最適化の「めんどくさい」を AWS FinOps Agent でチョット楽にする
classmethod_kaz
0
260
Driving AI Adoption Using In-House GPUs to Serve Qwen
po3rin
2
460
Benchmarking Vector Databases: pgvector vs. LanceDB
tsho
0
150
『止めない』を設計する — 制約の中で、事業の根幹を支える判断
hiroyaterui
0
210
Azure App Service / Container Apps の組み込み認証
kuniteru
0
210
GuardDuty 検知対応を DevOps Agent で効率化しようとしている話 / GuardDuty Investigations with DevOps Agent
masahirokawahara
1
320
Autonomous AI Databaseサービス・アップデート(FY27)/ adb-service-update-jp-fy27
oracle4engineer
PRO
0
130
Featured
See All Featured
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
A Tale of Four Properties
chriscoyier
163
24k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
410
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
RailsConf 2023
tenderlove
30
1.5k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
470
The Curse of the Amulet
leimatthew05
2
14k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
580
Transcript
CSS Critical Path by Valerio Sillari October 2017
Back to basics
How Browser Works
Browser Step for rendering/displaying a page Build DOM Build CSSOM
Render Tree Layout Paint
And CSS and JS?
How Browsers display a page Build DOM Build CSSOM Render
Tree Layout Paint Get CSS Get JS
Javascript is parser blocking When the parser finds a script
tag in the document, it blocks DOM construction (step 1), then waits for the browser to get the file and for the javascript engine to parse the script
How Browsers display a page Build DOM Build CSSOM Render
Tree Layout Paint Blocked Get CSS Get JS If we have some JS tag into the document, during the building DOM, we block the page
That’s why JS usually is at the bottom of body
You load first all the DOM, then load the js so it will not block it
BUT ...
JS is also stringly connected with CSS So it needs
also to have all the css already loaded in the CSSOM moment...
JS and CSS Build DOM Build CSSOM Render Tree Layout
Paint Blocked Get CSS Get JS JS need not only to be requested, but also parse ALL the css if exist PARSE CSS RUN JS
Solution: It doesn’t block DOM construction and don’t have the
need to wait for the CSSOM event Async scripts
How Browsers display a page Build DOM Build CSSOM Render
Tree Layout Paint Get CSS Async JS
And CSS?
For building the CSSOM (step2), the CSS parser goes through
each selector (tag, class or ID) in the CSS file and gets the styles attributed to it.
How Browsers display a page Build DOM Build CSSOM Render
Tree Layout Paint Blocked Get CSS Get JS Until we do not have ALL the css file loaded and parsed, we can not start to build the CSSOM.
CSS is render blocking The browser blocks page rendering until
it receives and processes all the css files
How Browsers display a page Build DOM Build CSSOM Render
Tree Layout Paint Blocked Get CSS Get JS Until we do not have ALL the css file loaded and parsed, we can not start to build the CSSOM.
None
CSS is the “enemy”
That’s Critical Path Css
Solutions?
Solution 01: They does not block the render of the
page! Inline styles
None
Technically, inline styles not required any css file with extra
request, and they not “block” the DOM and CSSOM
But basically impossible to maintain ...
Solution 02: Load first only basic code, then the rest
Split CSS
“Ideally, the ATF (above the fold) content should fit under
14KB — this allows the browser to paint the page after just one round trip…” https://developers.google.com/speed/docs/insights/mobile Google Page Speed
So you have 14kb to use, for delivering the DOM
+ CSS. You can split the CSS in 2 files: - The basic stuff (above the fold) - The Fanciness Stuff
Load CSS by Filament Group
Solution 03: Set inline styles with automation Inline Styles by
Task Runner
Critical by Addy Osmani
Solution 04: Not load CSS at all (until JS will
do it for you) CSS in JS
React / Angular / Vue etc... They take care of
the CSS using JS A quick example: https://vue-nuxt-test-valerio.herokuapp.com/
The Future? JS take care of the rendering of the
page. No DOM + CSS loaded at first New Css Logic
The end. Thanks. github.com/valeriosillari @stellavalerio