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
36
1
Share
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
申請待ちゼロへ!AWS × Entra IDで実現した「権限付与」のセルフサービス化
mhrtech
2
290
ふりかえりがなかった職能横断チームにふりかえりを導入してみて学んだこと 〜チームのふりかえりを「みんなで未来を考える場」にするプロローグ設計〜
masahiro1214shimokawa
0
380
Databricksで構築するログ検索基盤とアーキテクチャ設計
cscengineer
0
180
インフラを Excel 管理していた組織が 3 ヶ月で IaC 化されるまで
geekplus_tech
3
190
AgentCore RuntimeからS3 Filesをマウントしてみる
har1101
4
430
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.2k
Azure Static Web Apps の自動ビルドがタイムアウトしやすくなった状況に対応した件/global-azure2026
thara0402
0
180
プロンプトエンジニアリングを超えて:自由と統制のあいだでつくる Platform × Context Engineering
yuriemori
0
190
AI前提とはどういうことか
daisuketakeda
0
190
2026年に相応しい 最先端プラグインホストの設計<del>と実装</del>
atsushieno
0
110
新規サービス開発におけるReact Nativeのリアル〜技術選定の裏側と実践的OSS活用〜
grandbig
2
190
JOAI2026講評会資料(近藤佐介)
element138
1
110
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
96
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
260
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Code Review Best Practice
trishagee
74
20k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Practical Orchestrator
shlominoach
191
11k
HDC tutorial
michielstock
1
610
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
350
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
140
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Accessibility Awareness
sabderemane
0
96
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