Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Web Performance: Não deixe o usuário desistir d...
Search
Amanda Vilela
December 14, 2019
Programming
220
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Web Performance: Não deixe o usuário desistir do seu site
Talk apresentada no JS Day Recife 2019
Amanda Vilela
December 14, 2019
Transcript
114 slides
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!
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
130
Como tornamos os sorteios da BrazilJS on the Road Sorocaba mais divertidos utilizando JS
amandavilela
0
120
Sobre Carreira e Comunidades
amandavilela
0
85
PWA beyond theory - How to create your progressive web app
amandavilela
0
130
Crie seu Próprio Plano de Carreira
amandavilela
0
90
Como otimizar a performance da sua aplicação JS
amandavilela
0
140
Você nem sempre precisa de um framework JS
amandavilela
0
120
Que tal usar CSS em vez de JS?
amandavilela
1
140
Front-end: o que é, mercado e como começar
amandavilela
1
130
Other Decks in Programming
See All in Programming
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
630
Ruby から Emacs を操作したい
phigasui
0
390
AIコーディングをセッションで終わらせない: PHPライブラリ開発におけるコンテキスト承継設計
ickx
0
110
Agentic AI with the Power of Jakarta EE
ivargrimstad
0
190
AI Augmentation Techniques with Liberty
ivargrimstad
1
560
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
SODA - FACT BOOK(EN)
sodainc
1
280
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
240
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
190
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
0
120
小さなアプリを作って公開するまで
onozaty
0
240
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The browser strikes back
jonoalderson
0
2k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
530
Docker and Python
trallard
47
4.3k
Mind Mapping
helmedeiros
1
450
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
2k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
410
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
350
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k