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
Optimising Website Performance
Search
Thomas Stapleton
November 07, 2016
Technology
1
74
Optimising Website Performance
Optimising Website Performance & Chrome Dev Tools
Thomas Stapleton
November 07, 2016
Tweet
Share
More Decks by Thomas Stapleton
See All by Thomas Stapleton
Optimising Webpage Performance
tomsta93
1
18
Other Decks in Technology
See All in Technology
EMConf JP の楽しみ方 / How to enjoy EMConf JP
pauli
2
150
AWS re:Invent 2024 re:Cap Taipei (for Developer): New Launches that facilitate Developer Workflow and Continuous Innovation
dwchiang
0
180
デジタルアイデンティティ技術 認可・ID連携・認証 応用 / 20250114-OIDF-J-EduWG-TechSWG
oidfj
2
710
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!座学①
siyuanzh09
0
110
メンバーがオーナーシップを発揮しやすいチームづくり
ham0215
2
250
Visual StudioとかIDE関連小ネタ話
kosmosebi
1
380
GoogleのAIエージェント論 Authors: Julia Wiesinger, Patrick Marlow and Vladimir Vuskovic
customercloud
PRO
0
190
【Oracle Cloud ウェビナー】2025年のセキュリティ脅威を読み解く:リスクに備えるためのレジリエンスとデータ保護
oracle4engineer
PRO
1
110
自社 200 記事を元に整理した読みやすいテックブログを書くための Tips 集
masakihirose
2
350
今年一年で頑張ること / What I will do my best this year
pauli
1
230
月間60万ユーザーを抱える 個人開発サービス「Walica」の 技術スタック変遷
miyachin
1
160
Evolving Architecture
rainerhahnekamp
3
260
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Why Our Code Smells
bkeepers
PRO
335
57k
Designing Experiences People Love
moore
139
23k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
960
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Navigating Team Friction
lara
183
15k
Transcript
Optimising Website Performance By Thomas Stapleton @tomsta93
Web Performance • How Fast does your webpage load •
How Fast can a user interact with the page • How Fast does the application respond
Client Side Optimisation “If your application is slow, people won’t
use it.” - Fred Wilson • Versioning (fingerprint) assets • Compress and minify files
Client Side Optimisation • Minify HTML • Only load critical
content server side • Use async templates for non-critical components • Make sure your HTML is valid
Client Side Optimisation • Minify CSS (PostCSS -> cssnano) •
Bundle common SCSS/LESS into one stylesheet • Inline styles used for critical/non-critical components • Make sure your CSS is valid
Client Side Optimisation • Minify JavaScript • Remove blocking JavaScript
• Use a module loader • Make sure your JavaScript is versioned (fingerprinted)
Client Side Optimisation • Only load scripts if they are
required on the page • JavaScript bundles help… but don’t bundle everything • Use DRY, KISS & SOLID principles • Inline JavaScript if necessary
Client Side Optimisation • Upload onto CDN if available •
Version (image-v1.jpg) • Optimise images on upload (CMS) • Lazy Load images below window.innerHeight • Use SVGs where appropriate
Client Side Optimisation • Blocking fonts slow page speed •
Load fonts async • Avoid FOUT, FOIT, FOFT • Use only two fonts and two weights of each
Serving Static Assets • If you’re using HTTPS, enable HTTP2
• Two way proxy • Proxy cache • Correct headers e.g. e-tags, gzip, expiry
Serving Static Assets Headers are important, make sure they’re set.
X-* Headers are custom and like data- for HTML attributes
Serving Static Assets Before After
Proxy Cache 10x Faster! • Time Taken: 1s > 0.1s
• Individual Requests:10ms > 1ms • Transfer Rate: 38.6kb > 393.4kb Respond with 1000 304 requests a second
Navigation Timing API (W3C)
Navigation Timing API (W3C) HTML Parsing Complete 500 milliseconds
Navigation Timing API (W3C) Interaction 700 milliseconds
Navigation Timing API (W3C) Page Load 1 second
Developer Tools Get familiar with all types of developer tools
you may need to use them one day!
Chrome Developer Tools Build with HTML, CSS and JavaScript and
arguable the most used and best developer tools in any browser to date.
Overview • Elements - DOM nodes • Console - Errors
& logging • Sources - Downloaded files, snippets & debugging • Network - Latency & requests • Timeline - Time to first paint & processing • Profiles - Memory & execution time • Application - Cached files & browser data stores • Audits - Recommendations for network & performance improvements
• Elements - DOM nodes • Console - Errors &
logging • Sources - Downloaded files, snippets & debugging Overview • Network - Latency & requests • Timeline - Time to first paint & processing • Profiles - Memory & execution time • Application - Cached files & browser data stores • Audits - Recommendations for network & performance improvements Outline performance issues
Network • See screenshots of progress • Replicate connection speed
• Network queue overview • Protocol Type • Status • DOMContentLoaded • Load time • Breakdown of request processes
Timeline • Paint times • FPS • JS Evaluating &
Execution • Summary • Memory • Event Listeners
Time to First Paint • A white page can be
a valid ‘time to first paint’. • Large amounts of JavaScript execution blocking paint render. • The above is cause by poor code executing on scrolling.
Profiles • Function Execution Times • Memory Allocation • Memory
Usage & Monitoring • Direct JavaScript Function Monitoring
Application • Service Workers • Data/Web Stores • Sessions •
Cache
Service Workers https://www.youtube.com/watch?v=Cjo9iq8k-bc (jakearchibald.com 2016)
Questions Thank you for your time, any questions? WHO’S AWESOME?
You’re Awesome!
Useful Links • https://developers.google.com/web/fundamentals/performance/critical-rendering- path/measure-crp • https://docs.google.com/document/d/ 18GmrZjkpA8fxmCehjgMUg2_ujQs04a7RXlm7m_YcxVM/mobilebasic • https://jakearchibald.com/2016/streams-ftw/#creating-one-stream-from-multiple-
sources-to-supercharge-page-render-times • https://w3c.github.io/ServiceWorker/ • https://developers.google.com/web/fundamentals/performance/ • http://techblog.netflix.com/2015/08/making-netflixcom-faster.html • https://www.webpagetest.org/ • https://tools.pingdom.com/
References • https://www.w3.org/TR/navigation-timing/timing- overview.png • https://jakearchibald.com/2016/streams-ftw/ • https://www.w3.org/TR/service-workers/#cache