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
1
190
Web Performance: Não deixe o usuário desistir do seu site
Talk apresentada no JS Day Recife 2019
Amanda Vilela
December 14, 2019
Tweet
Share
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
91
Como tornamos os sorteios da BrazilJS on the Road Sorocaba mais divertidos utilizando JS
amandavilela
0
68
Sobre Carreira e Comunidades
amandavilela
0
42
PWA beyond theory - How to create your progressive web app
amandavilela
0
71
Crie seu Próprio Plano de Carreira
amandavilela
0
59
Como otimizar a performance da sua aplicação JS
amandavilela
0
100
Você nem sempre precisa de um framework JS
amandavilela
0
84
Que tal usar CSS em vez de JS?
amandavilela
1
110
Front-end: o que é, mercado e como começar
amandavilela
1
90
Other Decks in Programming
See All in Programming
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
4
400
GeistFabrik and AI-augmented software development
adewale
PRO
0
110
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
140
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
110
CSC509 Lecture 11
javiergs
PRO
0
310
CSC509 Lecture 13
javiergs
PRO
0
260
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
150
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
20
12k
ゼロダウンタイムでミドルウェアの バージョンアップを実現した手法と課題
wind111
0
210
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
11
4.8k
AI時代もSEOを頑張っている話
shirahama_x
0
100
What's New in Web AI?
christianliebel
PRO
0
130
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Typedesign – Prime Four
hannesfritz
42
2.9k
How to Ace a Technical Interview
jacobian
280
24k
Producing Creativity
orderedlist
PRO
348
40k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Invisible Side of Design
smashingmag
302
51k
A Tale of Four Properties
chriscoyier
162
23k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
330
Done Done
chrislema
186
16k
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!