SlideShare ist ein Scribd-Unternehmen logo
1 von 73
3 Tips to Deliver Fast Performance
Across Mobile Web
Stefan Baumgartner @ddprrt
Klaus Enzenhofer @kenzenhofer
Who we are
4.5 sec 15 sec
Why?
Network
Same Page
4.5 sec 15 secSanity Check
Browser CheckChrome 49 Chrome Mobile 33
Server Side
Local WLANLocal WLAN
Only difference is Browser & Device
Why did they look at the performance
on the mobile device?
Google - Mobile Friendliness Campaign?!
Change in their
compensations plan!
Contract SLA:
Average Response Time < 3 sec
User
on Desktop + Mobile
Good idea?!
Let’s talk about
response time
Network
Same Page
4.5 sec 15 secSanity Check
Browser CheckChrome 49 Chrome Mobile 33
Server Side
Local WLANLocal WLAN
4.5 sec 15 sec
UserDeveloper Operator
Let‘s take a look at the timings!
Navigation Start: 0 ms
Domain Lookup End: 269 ms
Connect End: 330 ms
Response Start: 517 ms
Response End: 518 ms
Dom Loading: 519 ms
Dom Interactive: 519 ms
DomContentLoaded Event End: 520 ms
Dom Complete: 520 ms
0.5 sec 0.5 sec
Developer
User Operator
User
DNS Lookup
Initial
connection
TTFB
(HTML)
Download
Life of an URL request
Starting here, we are able to
control …
<script src=“angular.js”> blocking!
<script src=“angular.js”> blocking!
<script src=“main.js”> blocking!
<script src=“angular.js”> blocking!
<script src=“main.js”> blocking!
start render
<script src=“angular.js”> blocking!
<script src=“main.js”> blocking!
start renderresponse time
The impact of a
JavaScript error
<script src=“angular.js”> blocking!
<script src=“main.js”> blocking!
start render?
Important content first
Everthing else is an enhancement
Single page application frameworks are aware
of this trend
- As long as you have valid routes (= URLs), you have
the ability to render the state on the server
- The first two requests are the document and the
styles of your application
- Then the JS framework kicks in
Server-side
rendering for SPA
Browser
App
ServingassetsAPIServer
GET /app
JavaScript payload
GET /api/users
JSON payload
GET /api/posts
GET /api/pages
JSON payload
JSON payload
Send index.html
Request JS application
Browser
App
UniversalrenderingAPIServer
GET /app
JavaScript payload
GET /api/users
JSON payload
GET /api/posts
GET /api/pages
JSON payload
JSON payload
Initial render HTML + CSS
Request JS application
4.5 sec 6 sec
UserDeveloper Operator
Operator
The CDN bill exploded!
285 Resources for an initial Page Load
151 CSS and 121 JavaScript files
~200 Resources had larger Header than Body
User
Mobile Data is
expensive
https://whatdoesmysitecost.com
http://cdn.shopify.com/s/files/1/1462/9702/articles/26_cangoroo_1024x1024.jpg?v=1473016235
Back Home
Back Home
HTTP Archive – Transfer Size Trend
http://httparchive.org/trends.php
Average Size ~2 500 KB
By 1.6 € per 100 KB
40 € to get started!!!!
2. Page weight
There’s lots of ways to reduce
the payload
Responsive images
<img src=”screenshot-600.png”
srcset="screenshot-200.png 200w,
screenshot-400.png 400w,
screenshot-600.png 600w,
screenshot-800.png 800w,
screenshot-1000.png 1000w,
screenshot-1200.png 1200w,
screenshot-1400.png 1400w,
screenshot-1600.png 1600w”
sizes="(min-width: 900px) 50vw, 100vw"
alt=”Super screenshot of our product.">
<img src=”screenshot-600.png”
srcset="screenshot-200.png 200w,
screenshot-400.png 400w,
screenshot-600.png 600w,
screenshot-800.png 800w,
screenshot-1000.png 1000w,
screenshot-1200.png 1200w,
screenshot-1400.png 1400w,
screenshot-1600.png 1600w”
sizes="(min-width: 900px) 50vw, 100vw"
alt=”Super screenshot of our product.">
These sources are available. For each “width unit”
there’s a reduced version of our original screenshot
The sizes define which source to choose from. Retina screens
are also checked
A low-res fallback image for browsers that don’t know srcset
Reduce styles
Tree shaking
4.5 sec 6 sec
UserDeveloper Operator
3. Now for the
returning visitor
Service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js')
.then(function(registration) { // Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) { // registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
}
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(function(response) { // Cache hit - return response
if (response) { return response; }
return fetch(event.request);
})
);
});
var CACHE_NAME = 'my-site-cache-v1';
var urlsToCache = [ '/', '/styles/main.css', '/script/main.js' ];
self.addEventListener('install', function(event) { // Perform install steps
event.waitUntil(
caches.open(CACHE_NAME)
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache);
})
);
});
2 sec 2.5 sec
UserDeveloper Operator
4.5 sec 15 sec
UserDeveloper Operator
UserDeveloper Operator
How to?
2.5 sec2 sec
4.5 sec 15 sec
UserDeveloper Operator
UserDeveloper Operator
How to?
2.5 sec2 sec
Happy Developer != Happy User
Your user might travel and mobile data is expensive
The returning user will appriciate your
caching strategy
You don‘t know how happy your users are?
https://www.dynatrace.com/trial/
Thank you!
Stefan Baumgartner
@ddpprt
Klaus Enzenhofer
@kenzenhofer

Weitere ähnliche Inhalte

Was ist angesagt?

Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
tkramar
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
timbc
 

Was ist angesagt? (20)

Asynchronous Processing with Ruby on Rails (RailsConf 2008)
Asynchronous Processing with Ruby on Rails (RailsConf 2008)Asynchronous Processing with Ruby on Rails (RailsConf 2008)
Asynchronous Processing with Ruby on Rails (RailsConf 2008)
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
 
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notes
 
Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
 
Altitude SF 2017: The power of the network
Altitude SF 2017: The power of the networkAltitude SF 2017: The power of the network
Altitude SF 2017: The power of the network
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark Tomlinson
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for Perl
 
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014
(WEB305) Migrating Your Website to AWS | AWS re:Invent 2014
 
Introduction to performance tuning perl web applications
Introduction to performance tuning perl web applicationsIntroduction to performance tuning perl web applications
Introduction to performance tuning perl web applications
 
Jon Arne Sæterås - Give Responsive Design a mobile performance boost
Jon Arne Sæterås - Give Responsive Design a mobile performance boost Jon Arne Sæterås - Give Responsive Design a mobile performance boost
Jon Arne Sæterås - Give Responsive Design a mobile performance boost
 
Getting started with AWS
Getting started with AWSGetting started with AWS
Getting started with AWS
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
 
Spreadshirt Techcamp 2018 - Hold until Told
Spreadshirt Techcamp 2018 - Hold until ToldSpreadshirt Techcamp 2018 - Hold until Told
Spreadshirt Techcamp 2018 - Hold until Told
 
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
 
Web performance: beyond load testing
Web performance: beyond load testingWeb performance: beyond load testing
Web performance: beyond load testing
 
Using Websockets in Play !
Using Websockets in Play !Using Websockets in Play !
Using Websockets in Play !
 
How to Install Magento on Google Cloud Engine (GCE)
How to Install Magento on Google Cloud Engine (GCE)How to Install Magento on Google Cloud Engine (GCE)
How to Install Magento on Google Cloud Engine (GCE)
 
Deploying and Scaling using AWS
Deploying and Scaling using AWSDeploying and Scaling using AWS
Deploying and Scaling using AWS
 
WordPress Need For Speed
WordPress Need For SpeedWordPress Need For Speed
WordPress Need For Speed
 

Andere mochten auch

Andere mochten auch (6)

Time for a new way to measure user experience
Time for a new way to measure user experienceTime for a new way to measure user experience
Time for a new way to measure user experience
 
How to Quantitatively Measure Your User Experience
How to Quantitatively Measure Your User ExperienceHow to Quantitatively Measure Your User Experience
How to Quantitatively Measure Your User Experience
 
The HEART framework for UX metrics
The HEART framework for UX metricsThe HEART framework for UX metrics
The HEART framework for UX metrics
 
Google HEART UX metrics framework
Google HEART UX metrics framework Google HEART UX metrics framework
Google HEART UX metrics framework
 
How Web Analytics can help User Experience
How Web Analytics can help User ExperienceHow Web Analytics can help User Experience
How Web Analytics can help User Experience
 
The ROI Of User Experience: Consider, Calculate & Measure Success
The ROI Of User Experience: Consider, Calculate & Measure SuccessThe ROI Of User Experience: Consider, Calculate & Measure Success
The ROI Of User Experience: Consider, Calculate & Measure Success
 

Ähnlich wie 3 Tips for a better mobile User Experience

[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
Christopher Schmitt
 

Ähnlich wie 3 Tips for a better mobile User Experience (20)

Responsive and Fast
Responsive and FastResponsive and Fast
Responsive and Fast
 
Software that eats the world! - PerformDay Brussels
Software that eats the world! - PerformDay BrusselsSoftware that eats the world! - PerformDay Brussels
Software that eats the world! - PerformDay Brussels
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
WPO Israel Meetup - Mobile Web Performance slides by Steve Souders
WPO Israel Meetup - Mobile Web Performance slides by Steve SoudersWPO Israel Meetup - Mobile Web Performance slides by Steve Souders
WPO Israel Meetup - Mobile Web Performance slides by Steve Souders
 
5 Steps to Faster Web Sites and HTML5 Games
5 Steps to Faster Web Sites and HTML5 Games5 Steps to Faster Web Sites and HTML5 Games
5 Steps to Faster Web Sites and HTML5 Games
 
5 steps to faster web sites & HTML5 games - updated for DDDscot
5 steps to faster web sites & HTML5 games - updated for DDDscot5 steps to faster web sites & HTML5 games - updated for DDDscot
5 steps to faster web sites & HTML5 games - updated for DDDscot
 
AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)
 
Belgrade when its just too slow
Belgrade when its just too slowBelgrade when its just too slow
Belgrade when its just too slow
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
 
Its Time To Stop Stalling: Mobile App and Video Performance
Its Time To Stop Stalling: Mobile App and Video PerformanceIts Time To Stop Stalling: Mobile App and Video Performance
Its Time To Stop Stalling: Mobile App and Video Performance
 
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
QA Fest 2019. Doug Sillars. It's just too Slow: Testing Mobile application pe...
 
Qa fest kiev_when its just too slow
Qa fest kiev_when its just too slowQa fest kiev_when its just too slow
Qa fest kiev_when its just too slow
 
Front End Optimization, 'The Cloud' can help you!
Front End Optimization, 'The Cloud' can help you!Front End Optimization, 'The Cloud' can help you!
Front End Optimization, 'The Cloud' can help you!
 
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
Faster web pages
Faster web pagesFaster web pages
Faster web pages
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAG
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
AWS Pop-up Loft Berlin: Cache is King - Running Lean Architectures: Optimizin...
AWS Pop-up Loft Berlin: Cache is King - Running Lean Architectures: Optimizin...AWS Pop-up Loft Berlin: Cache is King - Running Lean Architectures: Optimizin...
AWS Pop-up Loft Berlin: Cache is King - Running Lean Architectures: Optimizin...
 

Mehr von Klaus Enzenhofer

Mehr von Klaus Enzenhofer (11)

Get real time visibility into business outcomes and drive more efficient IT a...
Get real time visibility into business outcomes and drive more efficient IT a...Get real time visibility into business outcomes and drive more efficient IT a...
Get real time visibility into business outcomes and drive more efficient IT a...
 
BizOps Done Right: Breaking DevOps Silos to Deliver Great User Experiences
BizOps Done Right: Breaking DevOps Silos to Deliver Great User ExperiencesBizOps Done Right: Breaking DevOps Silos to Deliver Great User Experiences
BizOps Done Right: Breaking DevOps Silos to Deliver Great User Experiences
 
Monitoring Redefined - Austrian Testing Board
Monitoring Redefined - Austrian Testing BoardMonitoring Redefined - Austrian Testing Board
Monitoring Redefined - Austrian Testing Board
 
From 0 to DevOps: Lessons Learned Moving from On-Prem to Cloud Native
From 0 to DevOps: Lessons Learned Moving from On-Prem to Cloud NativeFrom 0 to DevOps: Lessons Learned Moving from On-Prem to Cloud Native
From 0 to DevOps: Lessons Learned Moving from On-Prem to Cloud Native
 
Why neglecting mobile monitoring is a 1-star strategy!
Why neglecting mobile monitoring is a 1-star strategy!Why neglecting mobile monitoring is a 1-star strategy!
Why neglecting mobile monitoring is a 1-star strategy!
 
The digital customer: The center of your universe
The digital customer: The center of your universeThe digital customer: The center of your universe
The digital customer: The center of your universe
 
Digital Mastery & Joy at Panera Bread
Digital Mastery & Joy at Panera BreadDigital Mastery & Joy at Panera Bread
Digital Mastery & Joy at Panera Bread
 
Ask the expert webinar: Unchaining real user data to drive business efficiencies
Ask the expert webinar: Unchaining real user data to drive business efficienciesAsk the expert webinar: Unchaining real user data to drive business efficiencies
Ask the expert webinar: Unchaining real user data to drive business efficiencies
 
From RUM to Robot Crawl Experience
From RUM to Robot Crawl Experience From RUM to Robot Crawl Experience
From RUM to Robot Crawl Experience
 
Web Performance the base for DevOps?! - Webperf Meetup Atlanta
Web Performance the base for DevOps?! - Webperf Meetup AtlantaWeb Performance the base for DevOps?! - Webperf Meetup Atlanta
Web Performance the base for DevOps?! - Webperf Meetup Atlanta
 
(R)evolutionize APM
(R)evolutionize APM(R)evolutionize APM
(R)evolutionize APM
 

Kürzlich hochgeladen

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Kürzlich hochgeladen (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

3 Tips for a better mobile User Experience

Hinweis der Redaktion

  1. Austrians that love Performance Were sitting together in the same classrooms at University
  2. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …
  3. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …
  4. https://www.google.com/webmasters/tools/mobile-friendly/
  5. https://www.google.com/webmasters/tools/mobile-friendly/
  6. https://www.google.com/webmasters/tools/mobile-friendly/
  7. Response Time story: What does < 3 sec response time mean? Does it mean your app’s complete, or does it start loading. User Exerpience vs Developer Experience. SLA fulfilled Truth is: Most SPAs kick in after “on load”  the ”fun” starts here. 0 sec Response time  blank screen What if JS does not load Your app depends on stable connection and high JS computational power Solution: Progressive Rendering. Server side first. JS kicks in later Two resources to load: Critical CSS file (Styles for main view), Finished HTML  Suddenly Response time is important again Everything then is Async and highly questionable
  8. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …
  9. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …
  10. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …
  11. UX vs DX
  12. Alright Klaus, let’s take a look at the user first… why is the user still wearing his sad face even though our SLA seems to be fulfilled.
  13. Well it’s most likely due to the fact the user is seeing something like this. Can you figure out what this application should do? No? Me neither… That’s because it’s missing one vital part to be of use: The content. So why is this happening?
  14. Let’s see how an URL request is constructed. You all have seen this before. We do a DNS lookup to see where we get our resources from, connect to the server, let the server handle the response and download the resource. Usually, the first request you’re doing is to an HTML page that contains all the markup and references to the content we want to display.
  15. So once this first HTML file is downloaded, we have the ability to control what’s happening in the front-end.
  16. With a single page application framework we usually do something like this: Downloading the framework’s JavaScript file! Resulting in a blocking request until we get some content on screen.
  17. We’re also downloading our own application of course, resulting in much likely a more longer request than before. Still blocking until we get some contents on screen. On mobile, this takes even longer because of network latency. Every request adds several round trips until you get to an actual response. And I’m just counting the response time of the resources here, not the time it needs to actually interpret and execute the JavaScript code that we just downloaded.
  18. Once this is done, we finally see the content rendered. This can take up to several seconds. If you follow the guidelines of your framework, you load the JavaScript files and the end of your application, and most likely asynchronous and deferred. Which means that those requests don’t add up to the response time.
  19. The actual response time of your application triggers when the original HTML file is downloaded! Resulting in this huge gap between response time and perceived render time.
  20. Even worse… there’s the possibility that some of your code might break. Or imagine having a flaky internet connection, where some requests just get cancelled and won’t get transferred at all. This can happen on mobile. More often than we like. The result? Your user triggering a 500 mill response time but waiting for ages to actually see something.
  21. So why not use the first request and try to get the most important thing out there before we request the application: Content for the visitor.
  22. Deliver the most important content with the first request, everything that comes after that is just an enhancement.
  23. This is a trend all major single page applications frameworks are aware of. Every framework now uses routes, which are de facto URLs, to keep the state of the application. With those routes, they also have the opportunity to render said state on the server. So the first request that you receive on the client is actually a server-rendered version of the state the JS app would deliver once it’s loaded. Just then, the JavaScript framework and application is loaded and kicks in.
  24. Let’s take a look into that in detail.
  25. Usually, we request the app, it delivers a static HTML file, we request the JavaScript application, and after that’s rendered, we make calls to an API server. Classic SPA.
  26. With server side rendering we want to make the first response count. Deliver everything that is needed to actually see content and allow the user to interact with the application. Then the JavaScript application loads and takes over. Perfect idea of progressive enhancement with single page applications!
  27. There are lots of solutions already out there. If you use Ember, having server side rendering comes for free. You install Fastboot, and fastboot does everything for you.
  28. It’s a little more complex in the React ecosystem. As usual, you have lots of choices which are all varying in the details. Also, there’s no switch-on solution, you have to do a lot by yourself. On the plus-side: There are solutions that work with other server environments than Node.js.
  29. Angular 2 also has a server side rendering solution called “Universal Angular 2”, which is pretty much in the vein of Ember’s fastboot.
  30. So with that, we make our user somewhat happier... But we still have a sad operator
  31. UX vs DX
  32. 1. Bandwidth topic and dataplan 2. “Klausi did a Journey”. Australia story  4$ per MB 3. What does my site cost www.whatdoesmysitecost.com 4. Roaming??? 5. Local: Income vs data plan 6. Header vs Payload  HTTP1 Problem Solutions: Reduce to essentials  Tooling Uncss, Treeshaking, Do I need this fancy pop-up?, Responsive Images
  33. You know that already, there’s lots of ways to reduce the payload we’re sending to the client. Running your images through ImageOptim, minifying and gzipping your CSS and JavaScript, all things that are by the book. So let’s what else can we do and what’s directly geared towards mobile web.
  34. First, there’s responsive images.
  35. The idea of responsive images is that you have a ton of different screen sizes, why download the same image to all those varying screens. Why not tailor the payload of an image as well as the content of an image to the screen at hat. The Responsive Images Community Group did an outstanding work in specify a standard. There’s a lot to this standard, including new elements and new browser algorithms, but I want to show you a quick example that’s sort of a quick win with Responsive images.
  36. So.. This is a spiced up image element. The colored parts are brand new. You see a property called “srcset” and one called “sizes”, and they all feature different values.
  37. The srcset property features a list of images that are defined for a certain “width unit”. I call it width unit because it’s not pixel on Retina screens. So this is the set where the browser can choose the images from. The sizes property define the rules which image to choose. First we start with the exception, which says that at a minimum resolutin of 900px, take a screenshot that’s at least half the width of the viewport. For all other cases, take one that’s at least 100% of the viewport. The browser evaluates those rules, gets a width unit value, and selects one of the images defined above. If the browser doesn’t know those properties, he still falls back to the original src attribute. As easy as that. Quick win for reducing the payload on smaller screens.
  38. Next, reduce styles. The advanced edition. Not only can you reduce stylesheets by minifying and gzipping them, but there’s also a nice tool out there that allows us to filter styles that aren’t used.
  39. It’s called UnCSS and is super helpful if you use frameworks like bootstrap. Bootstrap comes with a gazillion of components, but most sites only use roughly 20% of it. This tool checks which parts of this framework are used on that page, the rest is removed.
  40. Last, but not least, there’s a new technique out there called tree shaking, which is something like UnCSS but for JavaScript, especially if you use the new ES16 standard.
  41. Take a look at the code. With ES16 you are able to do modules, and export various functions from a module. The code on the upper left is a “math” library. In our application code in the lower left corner, we just import one function from this library, namely “cube”. The output on the right is a bundle created through tree shaking. Instead of including the whole “math.js” file, we just include the part that we need. This can reduce your application code significantly. And all major frameworks are going to build up on that. Which means even more reduced application files in the future!
  42. Tools that support tree shaking already are things like Rollup.js
  43. And Google’s Closure compiler… this godfather of JavaScript minifying tools is also the one that’s being used in AngularJS 2.
  44. Alright, … so we came down to reducing the costs and the requests and the payload. User is happy because he’s getting a fast app, and the operator is getting a much smaller bill than before.
  45. But this is just for the first view.. Let’s do something for the returning visitor to pump our game up even more. You know by now that you should find good cache headers and aim for leaving as much content on the client, rather than requesting in further and further… but there’s one new thing that you can use which ups your offline game even more, and especially on mobile.
  46. It’s called service worker… let me show you quickly how this works:
  47. Su, usually the browser is request a resource from the world wide web. That’s the blue arrow. The response delivers this resource to the client, and the client stores it in the cache.
  48. With service workers, you have a man in the middle which can check each request and can help you modifying it. So instead of talking to the web server directly, the service worker passes each request through, and checks if it should do something with it. A typical call is browser does a request… service worker analyises this request and passes it to the webserver. The response is getting stored into a cache by the service worker and delivered to the client.
  49. So… let’s assume the web server is down... Or not reachable because your client is offline. In that case, the service worker sees that the connection is not there, and will request the resource from the cache instead from the web. The biggest benefit compared to existing solutions: This works offline. No internet connection required!
  50. Here’s some sample code. I don’t want to get too much into detail given the time, but registering a service worker is done with the appropriate call… A service worker is nothing more than a JavaScript file that uses certain APIs. This service worker now is getting installed and is avaiable to the client.
  51. The upper portion of the code creates a cache on install. It also tells the cache which resources to store. The second portion of the code listens on each fetch request. Everytime a resource is requested, the service worker checks if there’s something in store, otherwise it will pass it to the network. This adds offline functionality to your app!
  52. This is of course just a basic scenario. If you need more, I highly recommend going to the service worker toolbox. It provides a great API and lots of recipes for advanced use cases
  53. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …
  54. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …
  55. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …
  56. Gleiche Bedingungen. Only difference: Device and Browser! HTTP2 vs HTTP1 More Calculation Power …