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
Web Performance: Não deixe o usuário desistir d...
Search
Amanda Vilela
December 14, 2019
Programming
200
1
Share
Web Performance: Não deixe o usuário desistir do seu site
Talk apresentada no JS Day Recife 2019
Amanda Vilela
December 14, 2019
More Decks by Amanda Vilela
See All by Amanda Vilela
Construindo sua primeira página web: Sua porta de entrada para uma carreira de front-end
amandavilela
1
110
Como tornamos os sorteios da BrazilJS on the Road Sorocaba mais divertidos utilizando JS
amandavilela
0
88
Sobre Carreira e Comunidades
amandavilela
0
62
PWA beyond theory - How to create your progressive web app
amandavilela
0
93
Crie seu Próprio Plano de Carreira
amandavilela
0
71
Como otimizar a performance da sua aplicação JS
amandavilela
0
120
Você nem sempre precisa de um framework JS
amandavilela
0
95
Que tal usar CSS em vez de JS?
amandavilela
1
120
Front-end: o que é, mercado e como começar
amandavilela
1
99
Other Decks in Programming
See All in Programming
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
490
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
3
520
アーキテクチャモダナイゼーションとは何か
nwiizo
17
5k
事業会社でのセキュリティ長期インターンについて
masachikaura
0
250
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
230
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
1
280
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
720
「速くなった気がする」をデータで疑う
senleaf24
0
170
Vibe NLP for Applied NLP
inesmontani
PRO
0
370
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
170
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
130
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
270
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
140
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Ruling the World: When Life Gets Gamed
codingconduct
0
190
Believing is Seeing
oripsolob
1
110
For a Future-Friendly Web
brad_frost
183
10k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
130
Transcript
Web Performance Não deixe o usuário desistir do seu site
Amanda Vilela Desenvolvedora front-end, freelancer na Toptal, organizadora de algumas
comunidades de Sorocaba. • amandavilela.com • @amandavilela___ Oi :) 2
Importância da performance
Usuários não gostam de coisas lentas
Como melhorar a performance?
None
None
First Contentful Paint (FCP)
Time To Interactive (TTI)
None
Carregar o mínimo e mostrar algo relevante para o usuário
1. Remova o que não tem importância
None
Minifique o código
None
- 12,4 KB
• Minifier: An online tool minifies JavaScript or CSS via
copy and paste. • Grunt: An NPM minification package that integrates into the Grunt workflow. • Gulp: An NPM minification package that integrates into the Gulp workflow. • Frameworks: Separe o modo desenvolvimento de produção
Revise a necessidade de certas libs
None
None
None
Só envie o código que o usuário precisa
None
None
None
- 7,5 KB
None
None
- 43,3 KB
None
None
None
Remova imagens desnecessárias
None
Otimize as imagens que restarem
None
None
None
None
• SVG no que for possível, mas não esqueça de
otimizar também: svgomg • Substitua GIFs por vídeos: WebM e MP4, ffmpeg
Não redimensione imagens no HTML nem no CSS
Imagens responsivas
Antes: Depois:
2. Use Lazy Load
First-View e o Above the Fold
None
None
None
Cuidado com o reflow!
None
None
None
None
3. Evite carregar a fonte no CSS
None
None
None
Self host para melhor performance
None
4. Reduza a quantidade de requests
None
CSS Inline
sim, CSS Inline
Above the Fold
None
None
- 44,1 KB Antes: Depois:
Cuidado com o tamanho do DOM!
5. Ative o GZip
None
6. Reduza os scripts bloqueantes
Uma tag <script> que: • Está no <head> do documento;
• Não tem um atributo defer; • Não tem um atributo async;
Carregamento assíncrono de CSS
None
7. Lazy load no JS
None
None
None
None
Comparação
8. Adapte com base na qualidade da rede
None
None
None
None
9. Faça cache dos recursos estáticos
HTTP cache headers
None
Service Worker
None
None
10. Código transpilado e mais bytes
None
None
11. Use HTTP2
Monitorando Métricas
None
None
None
None
None
None
Performance Budgets
budget.json
None
None
None
Lighthouse Bot
None
Referências • https://www.awwwards.com/brain-food-perceived-performance • https://developers.google.com/web/fundamentals/performance/why-performance-matters • https://developers.google.com/web/tools/chrome-devtools/coverage • https://developers.google.com/web/tools/chrome-devtools/evaluate-performance •
https://web.dev/fast/ • https://www.filamentgroup.com/lab/inlining-cache.html • https://web.dev/using-lighthouse-bot-to-set-a-performance-budget/
Slides: speakerdeck.com/amandavilela
Pull Request em: https://github.com/JSdayBR/recife
http://bit.ly/toptal-amanda
Obrigada!