SlideShare ist ein Scribd-Unternehmen logo
Lead UI Developer
at Field Intelligence
Anna Migas
Google Developer Expert
Anna Migas
@szynszyliszys
The secret web
performance metric
no one is talking about
“Web performance refers to the
speed in which web pages are
downloaded and displayed
on the user's web browser“
wikipedia.org/wiki/Web_performance
web performance
User experience connected to the
web performance
User experience connected to the
web performance
from a perspec
ti
ve of an average
user in Africa
Why should you care?
Africa is far.
It is a problem for anyone:
1. Using an old device
2. Located in a rural area
3. Using an enterprise app that is
hard to op
ti
mise
Most web performance
metrics and resources
are developed with a
privileged user in mind.
For some users, the
good web performance
is not achievable at all.
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
h
tt
ps://www.webperf.
ti
ps/
ti
p/cached-js-misconcep
ti
ons/
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
h
tt
ps://www.webperf.
ti
ps/
ti
p/cached-js-misconcep
ti
ons/
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
h
tt
ps://www.webperf.
ti
ps/
ti
p/cached-js-misconcep
ti
ons/
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
h
tt
ps://www.webperf.
ti
ps/
ti
p/cached-js-misconcep
ti
ons/
Latency
Latency is generally considered to be the
amount of
ti
me it takes from when a request is
made by the user to the
ti
me it takes for the
response to get back to that user.
h
tt
ps://developer.mozilla.org/en-US/docs/Web/Performance/
Latency in most parts of
Africa is really high.
High latency means long
Time To First Byte
(TTFB).
Latency in most parts of
Africa is really high.
High latency means long
Time To First Byte
(TTFB).
“While a good TTFB doesn’t
necessarily mean you will have a
fast website, a bad TTFB almost
certainly guarantees a slow one.”
— Harry Roberts
h
tt
ps://csswizardry.com/2019/08/
ti
me-to-
fi
rst-byte-what-it-is-and-why-it-ma
tt
ers/
“At a high level, there are two primary
performance bo
tt
lenecks on the web:
1. Networking - the round-trip
ti
me to acquire
an asset or data payload from a remote server
2. End-user Device Compute - the amount of
computa
ti
onal overhead required on the
end-user's device”
Devices used
“The country [Nigeria] is considered a mobile-
fi
rst market where infrastructure and online
usage development skipped wide-ranging
desktop PC adop
ti
on and went straight to
mobile internet usage via inexpensive
smartphones instead.”
h
tt
ps://www.sta
ti
sta.com/sta
ti
s
ti
cs/183849/internet-users-nigeria/
“Time spent in Parse/Compile can
often be 2–5x as long on phones
as on desktop.”
— Addy Osmani
h
tt
ps://medium.com/reloading/javascript-start-up-performance-69200f43b201
h
tt
ps://medium.com/reloading/javascript-start-up-performance-69200f43b201
Secret web
performance metric:
Pa
ti
ence
How long are you willing
to wait for the website to
load, before you decide
it is broken?
Pa
ti
ence metric:
If everything is slow,
what can we do?
1. Visibility of system
status
“The design should always keep users
informed about what is going on, through
appropriate feedback within a reasonable
amount of
ti
me.”
h
tt
ps://www.nngroup.com/ar
ti
cles/ten-usability-heuris
ti
cs/
1. Visibility of system
status
“The design should always keep users
informed about what is going on, through
appropriate feedback within a reasonable
amount of
ti
me.”
h
tt
ps://www.nngroup.com/ar
ti
cles/ten-usability-heuris
ti
cs/
Make sure to give user informa
ti
on
as fast as possible:
• What is going on
• How long it can take
• Once error occurs (and what can be done)
Take into account digital literacy
• Use simple language
• Discourage damaging ac
ti
ons (“Do you
really want to navigate out and stop the
ongoing download?”)
• Explain consequences of ac
ti
ons (for
example “pull to refresh”)
2. Render ini
ti
al
informa
ti
on ASAP
Make sure there is some ini
ti
al content visible
le
tti
ng user know what is going on quick.
3. Leverage Progressive
Enhancement
Make it possible to achieve the most crucial
ac
ti
on
fi
rst, add extra features and
fi
reworks
on top of that.
4. Avoid request
chaining and roundtrips
Consider using browser hints.
A. Preconnect
Eliminate many costly roundtrips from your
request path (for example establish
connec
ti
on with CDN used later)
<link href="https://cdn.domain.com" rel="preconnect"
crossorigin>
B. Prefetch
Fetch resources and store them in cache.
Use for resources that might be needed for
next naviga
ti
on.
<link rel="prefetch" href="/images/big.jpeg">
C. Preload
Load late-discovered resources early.
<link rel="preload" href="font.woff2" as="font"
type="font/woff2" crossorigin>
5. Lazy load resources
that are not cri
ti
cal
Don’t force user to download resources they
might never discover.
<img src="image.png" loading="lazy" alt=“alt text”
width="200" height="200">
6. Op
ti
mise images you
ship
Images are usually the heaviest resources on
the web.
Op
ti
mise image loading
• Use correct and modern formats
• Use tools to op
ti
mise size:
• h
tt
ps://jakearchibald.github.io/svgomg/
• h
tt
ps://squoosh.app/
• h
tt
ps://imageop
ti
m.com
Op
ti
mise image loading
• Add size / aspect ra
ti
o to avoid layout
shifts
.img-class { aspect-ratio: 16 / 9; }
.img-class
{

width: 100px
;

height: 20px
;

}
7. Learn about network
resource hints
Network Informa
ti
on API helps web
applica
ti
ons to access informa
ti
on about the
user's network.
navigator.connection.saveData
h
tt
ps://developer.mozilla.org/en-US/docs/Web/API/Network_Informa
ti
on_API
8. Limit third party
resources
Third party resources can delay ini
ti
al load of
the page. Load them asynchronously
whenever possible.
<script async src="external.js"></script>
<script defer src="external.js"></script>
9. Test for back/forward
cache
If a user clicks on a naviga
ti
on item by
mistake, it can minimise the
ti
me to navigate
back.
h
tt
ps://developer.chrome.com/docs/devtools/applica
ti
on/back-forward-cache/
h
tt
ps://web.dev/bfcache/
10. Consider using
Service Worker
If you expect your page to be visited on regular
basis, you can cache resources be
tt
er.
h
tt
ps://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
11. Avoid crea
ti
ng too
many layers
Each layer created by the browser takes
device’s resources.
h
tt
ps://blog.logrocket.com/eliminate-content-repaints-with-the-new-layers-panel-in-
chrome-e2c306d4d752/
12. Minimise website
repaints
While interac
ti
ng with the page, a lot of
interac
ti
ve resources can force browser to
repaint content.
h
tt
ps://web.dev/simplify-paint-complexity-and-reduce-paint-areas/
Summary
★ Let user know what is going on
★ Load ini
ti
al informa
ti
on early
★ Progressively enhance your website
★ Avoid request chaining and use resource
hints
★ Lazy load content below the fold
★ Op
ti
mise images
★ Leverage Network Informa
ti
on API
Summary
★ Limit third party resources (and if you need
them use async loading)
★ Op
ti
mise for back/forward cache
★ Consider using Service Worker if applicable
★ Avoid using too many layers and repain
ti
ng
content
Resources
• MDN: Understanding latency
h
tt
ps://developer.mozilla.org/en-US/docs/Web/Performance/
Understanding_latency
• Interac
ti
ve map of network speed worldwide
h
tt
ps://www.cable.co.uk/broadband/speed/worldwide-speed-
league/
• The African web ecosystem - a paper
h
tt
ps://www.caida.org/catalog/papers/
2018_exploring_analysing_african_web/
exploring_analysing_african_web.pdf
Resources
• web.dev: Establishing early connec
ti
ons with resource hints
h
tt
ps://web.dev/preconnect-and-dns-prefetch/
• web.dev: Preloading cri
ti
cal assets
h
tt
ps://web.dev/preload-cri
ti
cal-assets/
• web.dev: Loading third party assets
h
tt
ps://web.dev/e
ffi
ciently-load-third-party-javascript/
Resources
• The psychology of web performance
h
tt
ps://blog.uptrends.com/web-performance/the-psychology-of-
web-performance/
• Designer's guide to perceived web performance
h
tt
ps://marvelapp.com/blog/a-designers-guide-to-perceived-
performance/
Anna Migas
@szynszyliszys
Thank you!

Weitere ähnliche Inhalte

Ähnlich wie Secret Performance Metric - Armada JS.pdf

Ähnlich wie Secret Performance Metric - Armada JS.pdf (20)

20181023 progressive web_apps_are_here_sfcampua
20181023 progressive web_apps_are_here_sfcampua20181023 progressive web_apps_are_here_sfcampua
20181023 progressive web_apps_are_here_sfcampua
 
Browser Based Performance Testing and Tuning
Browser Based Performance Testing and TuningBrowser Based Performance Testing and Tuning
Browser Based Performance Testing and Tuning
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
 
Let's Take Drupal Offline!
Let's Take Drupal Offline!Let's Take Drupal Offline!
Let's Take Drupal Offline!
 
Supercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy UsersSupercharge Application Delivery to Satisfy Users
Supercharge Application Delivery to Satisfy Users
 
Progressive Web Apps by Millicent Convento
Progressive Web Apps by Millicent ConventoProgressive Web Apps by Millicent Convento
Progressive Web Apps by Millicent Convento
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
 
Presemtation Tier Optimizations
Presemtation Tier OptimizationsPresemtation Tier Optimizations
Presemtation Tier Optimizations
 
WebE_chapter_16.ppt
WebE_chapter_16.pptWebE_chapter_16.ppt
WebE_chapter_16.ppt
 
Basic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web AppsBasic Understanding of Progressive Web Apps
Basic Understanding of Progressive Web Apps
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress Hosting
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
 
Demystifying web performance tooling and metrics
Demystifying web performance tooling and metricsDemystifying web performance tooling and metrics
Demystifying web performance tooling and metrics
 
Business of Front-end Web Development
Business of Front-end Web DevelopmentBusiness of Front-end Web Development
Business of Front-end Web Development
 
How to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - EnglishHow to be Successful with Responsive Sites (Koombea & NGINX) - English
How to be Successful with Responsive Sites (Koombea & NGINX) - English
 
Progressive Web Apps - NPD Meet
Progressive Web Apps - NPD MeetProgressive Web Apps - NPD Meet
Progressive Web Apps - NPD Meet
 
Basic Introduction to Web Development
Basic Introduction to Web DevelopmentBasic Introduction to Web Development
Basic Introduction to Web Development
 
PWA basics for developers
PWA basics for developersPWA basics for developers
PWA basics for developers
 
Doug Sillars on App Optimization
Doug Sillars on App OptimizationDoug Sillars on App Optimization
Doug Sillars on App Optimization
 
WTF R PWAs?
WTF R PWAs?WTF R PWAs?
WTF R PWAs?
 

Mehr von Anna Migas

Mehr von Anna Migas (10)

HalfStack fast but not furious
HalfStack fast but not furiousHalfStack fast but not furious
HalfStack fast but not furious
 
Performance.now() fast but not furious
Performance.now()   fast but not furiousPerformance.now()   fast but not furious
Performance.now() fast but not furious
 
NordicJS: Fast but not Furious: Debugging User Interaction Performance Issues
NordicJS:  Fast but not Furious: Debugging User Interaction Performance IssuesNordicJS:  Fast but not Furious: Debugging User Interaction Performance Issues
NordicJS: Fast but not Furious: Debugging User Interaction Performance Issues
 
Fullstack 2018 - Fast but not furious: debugging user interaction performanc...
Fullstack 2018 -  Fast but not furious: debugging user interaction performanc...Fullstack 2018 -  Fast but not furious: debugging user interaction performanc...
Fullstack 2018 - Fast but not furious: debugging user interaction performanc...
 
Fast but not furious: debugging user interaction performance issues
Fast but not furious: debugging user interaction performance issuesFast but not furious: debugging user interaction performance issues
Fast but not furious: debugging user interaction performance issues
 
Web Zurich - Make your animations perform well
Web Zurich - Make your animations perform wellWeb Zurich - Make your animations perform well
Web Zurich - Make your animations perform well
 
HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well
 
Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017
 
Make your animations perform well
Make your animations perform wellMake your animations perform well
Make your animations perform well
 
Be brave and Open Source
Be brave and Open SourceBe brave and Open Source
Be brave and Open Source
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 

Secret Performance Metric - Armada JS.pdf

  • 1. Lead UI Developer at Field Intelligence Anna Migas Google Developer Expert
  • 2. Anna Migas @szynszyliszys The secret web performance metric no one is talking about
  • 3. “Web performance refers to the speed in which web pages are downloaded and displayed on the user's web browser“ wikipedia.org/wiki/Web_performance
  • 5. User experience connected to the web performance
  • 6. User experience connected to the web performance from a perspec ti ve of an average user in Africa
  • 7.
  • 8. Why should you care? Africa is far.
  • 9. It is a problem for anyone: 1. Using an old device 2. Located in a rural area 3. Using an enterprise app that is hard to op ti mise
  • 10. Most web performance metrics and resources are developed with a privileged user in mind.
  • 11. For some users, the good web performance is not achievable at all.
  • 12. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device” h tt ps://www.webperf. ti ps/ ti p/cached-js-misconcep ti ons/
  • 13. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device” h tt ps://www.webperf. ti ps/ ti p/cached-js-misconcep ti ons/
  • 14. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device” h tt ps://www.webperf. ti ps/ ti p/cached-js-misconcep ti ons/
  • 15. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device” h tt ps://www.webperf. ti ps/ ti p/cached-js-misconcep ti ons/
  • 16. Latency Latency is generally considered to be the amount of ti me it takes from when a request is made by the user to the ti me it takes for the response to get back to that user. h tt ps://developer.mozilla.org/en-US/docs/Web/Performance/
  • 17. Latency in most parts of Africa is really high. High latency means long Time To First Byte (TTFB).
  • 18. Latency in most parts of Africa is really high. High latency means long Time To First Byte (TTFB).
  • 19. “While a good TTFB doesn’t necessarily mean you will have a fast website, a bad TTFB almost certainly guarantees a slow one.” — Harry Roberts h tt ps://csswizardry.com/2019/08/ ti me-to- fi rst-byte-what-it-is-and-why-it-ma tt ers/
  • 20. “At a high level, there are two primary performance bo tt lenecks on the web: 1. Networking - the round-trip ti me to acquire an asset or data payload from a remote server 2. End-user Device Compute - the amount of computa ti onal overhead required on the end-user's device”
  • 21. Devices used “The country [Nigeria] is considered a mobile- fi rst market where infrastructure and online usage development skipped wide-ranging desktop PC adop ti on and went straight to mobile internet usage via inexpensive smartphones instead.” h tt ps://www.sta ti sta.com/sta ti s ti cs/183849/internet-users-nigeria/
  • 22. “Time spent in Parse/Compile can often be 2–5x as long on phones as on desktop.” — Addy Osmani h tt ps://medium.com/reloading/javascript-start-up-performance-69200f43b201
  • 25. How long are you willing to wait for the website to load, before you decide it is broken? Pa ti ence metric:
  • 26. If everything is slow, what can we do?
  • 27. 1. Visibility of system status “The design should always keep users informed about what is going on, through appropriate feedback within a reasonable amount of ti me.” h tt ps://www.nngroup.com/ar ti cles/ten-usability-heuris ti cs/
  • 28. 1. Visibility of system status “The design should always keep users informed about what is going on, through appropriate feedback within a reasonable amount of ti me.” h tt ps://www.nngroup.com/ar ti cles/ten-usability-heuris ti cs/
  • 29. Make sure to give user informa ti on as fast as possible: • What is going on • How long it can take • Once error occurs (and what can be done)
  • 30.
  • 31.
  • 32. Take into account digital literacy • Use simple language • Discourage damaging ac ti ons (“Do you really want to navigate out and stop the ongoing download?”) • Explain consequences of ac ti ons (for example “pull to refresh”)
  • 33. 2. Render ini ti al informa ti on ASAP Make sure there is some ini ti al content visible le tti ng user know what is going on quick.
  • 34.
  • 35.
  • 36. 3. Leverage Progressive Enhancement Make it possible to achieve the most crucial ac ti on fi rst, add extra features and fi reworks on top of that.
  • 37.
  • 38. 4. Avoid request chaining and roundtrips Consider using browser hints.
  • 39. A. Preconnect Eliminate many costly roundtrips from your request path (for example establish connec ti on with CDN used later) <link href="https://cdn.domain.com" rel="preconnect" crossorigin>
  • 40. B. Prefetch Fetch resources and store them in cache. Use for resources that might be needed for next naviga ti on. <link rel="prefetch" href="/images/big.jpeg">
  • 41. C. Preload Load late-discovered resources early. <link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin>
  • 42. 5. Lazy load resources that are not cri ti cal Don’t force user to download resources they might never discover. <img src="image.png" loading="lazy" alt=“alt text” width="200" height="200">
  • 43. 6. Op ti mise images you ship Images are usually the heaviest resources on the web.
  • 44. Op ti mise image loading • Use correct and modern formats • Use tools to op ti mise size: • h tt ps://jakearchibald.github.io/svgomg/ • h tt ps://squoosh.app/ • h tt ps://imageop ti m.com
  • 45. Op ti mise image loading • Add size / aspect ra ti o to avoid layout shifts .img-class { aspect-ratio: 16 / 9; } .img-class { width: 100px ; height: 20px ; }
  • 46. 7. Learn about network resource hints Network Informa ti on API helps web applica ti ons to access informa ti on about the user's network. navigator.connection.saveData h tt ps://developer.mozilla.org/en-US/docs/Web/API/Network_Informa ti on_API
  • 47. 8. Limit third party resources Third party resources can delay ini ti al load of the page. Load them asynchronously whenever possible. <script async src="external.js"></script> <script defer src="external.js"></script>
  • 48. 9. Test for back/forward cache If a user clicks on a naviga ti on item by mistake, it can minimise the ti me to navigate back.
  • 50. 10. Consider using Service Worker If you expect your page to be visited on regular basis, you can cache resources be tt er. h tt ps://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
  • 51. 11. Avoid crea ti ng too many layers Each layer created by the browser takes device’s resources.
  • 53. 12. Minimise website repaints While interac ti ng with the page, a lot of interac ti ve resources can force browser to repaint content.
  • 55. Summary ★ Let user know what is going on ★ Load ini ti al informa ti on early ★ Progressively enhance your website ★ Avoid request chaining and use resource hints ★ Lazy load content below the fold ★ Op ti mise images ★ Leverage Network Informa ti on API
  • 56. Summary ★ Limit third party resources (and if you need them use async loading) ★ Op ti mise for back/forward cache ★ Consider using Service Worker if applicable ★ Avoid using too many layers and repain ti ng content
  • 57. Resources • MDN: Understanding latency h tt ps://developer.mozilla.org/en-US/docs/Web/Performance/ Understanding_latency • Interac ti ve map of network speed worldwide h tt ps://www.cable.co.uk/broadband/speed/worldwide-speed- league/ • The African web ecosystem - a paper h tt ps://www.caida.org/catalog/papers/ 2018_exploring_analysing_african_web/ exploring_analysing_african_web.pdf
  • 58. Resources • web.dev: Establishing early connec ti ons with resource hints h tt ps://web.dev/preconnect-and-dns-prefetch/ • web.dev: Preloading cri ti cal assets h tt ps://web.dev/preload-cri ti cal-assets/ • web.dev: Loading third party assets h tt ps://web.dev/e ffi ciently-load-third-party-javascript/
  • 59. Resources • The psychology of web performance h tt ps://blog.uptrends.com/web-performance/the-psychology-of- web-performance/ • Designer's guide to perceived web performance h tt ps://marvelapp.com/blog/a-designers-guide-to-perceived- performance/