SlideShare uma empresa Scribd logo
1 de 79
Baixar para ler offline
Build better 
responsive websites 
Hrvoje Jurišić, Inchoo
Nobody likes waiting
OMGcommerce 2014 @hrvojejurisic
Users expect 
2 seconds 
Source: akamai.com
After 3 seconds 
40% will leave 
Source: akamai.com
88% of customers 
will never come back 
Source: gomez.com
1 second delay 
7% less conversions 
Source: tagman.com
Amazon: 100 ms latency 
1% less revenue 
Source: highscalability.com
Bad performance 
Bad business
2013 load time: 7.2s 
2014 load time: 10.7s 
Source: http://www.radware.com/
2013: 1007 KB 
2014: 1677 KB 
Source: http://www.radware.com/
Source: http://httparchive.org/
55% of eCommerce traffic 
happens on mobile device 
Source: webperformancetoday.com
Mobile users expect sites to load 
as fast or even faster 
than on their desktops 
Source: strangeloopnetworks.com
Meet Magento New York 2014 @hrvojejurisic
4G to the 
rescue??
not so 
fast...
Source: igvita.com
Source: mobify.com
Source: facebook
Source: guypo.com 
Page Size 
Smallest resolution 
vs 
Biggest resolution
Popular themeforest Magento Theme
RWD is bad for 
performance!
6% of RWD sites 
done right
RWD is bad for performance!
RWD is bad for performance! 
Blame the 
implementation, 
not the technique
Speed is a feature 
treat it as a part of UX design
Mobile first, content out 
workflow 
Source: http://www.lukew.com
Set a 
performance budget 
Source: http://timkadlec.com
Optimization
Foundations:
Foundations: 
1. Reduce http requests
Foundations: 
1. Reduce http requests 
● Use CSS sprites 
● Use icon fonts 
● Merge javascript 
● Merge CSS
Foundations: 
1. Reduce http requests 
2. Gzip components
Foundations: 
1. Reduce http requests 
2. Gzip components 
3. Minify JS and CSS
Foundations: 
1. Reduce http requests 
2. Gzip components 
3. Minify JS and CSS 
4. Optimize images
Foundations: 
1. Reduce http requests 
2. Gzip components 
3. Minify JS and CSS 
4. Optimize images 
5. CSS at the top
Foundations: 
1. Reduce http requests 
2. Gzip components 
3. Minify JS and CSS 
4. Optimize images 
5. CSS at the top 
6. JS at the bottom or async
Foundations: 
1. Reduce http requests 
2. Gzip components 
3. Minify JS and CSS 
4. Optimize images 
5. CSS at the top 
6. JS at the bottom or async 
7. Use CDN
Tools 
1. Firebug/Web inspector 
2. webpagetest.org 
3. Google PageSpeed
Case study: 
Load time: 2.85s Start render: 2.95s Visually Complete: 3.1s Speed index: 3060
Javascript delivery 
● Merge JS files 
● Don’t block rendering
Javascript delivery - grouping js 
<default> 
<reference name="head"> 
<action method="addJs"> 
<script>prototype/prototype.js</script> 
</action> 
. . . 
. . . 
. . . 
<action method="addJs"> 
<script>scriptaculous/builder.js</script> 
</action> 
</reference> 
</default>
Javascript delivery - grouping js 
Homepage JS 
<script src="....ebbc8820d00736a6f2402ff7b21567b2.js"></script>
Javascript delivery - grouping js 
<catalog_product_view> 
<reference name="head"> 
<action method="addJs"> 
<script>varien/product.js</script> 
</action> 
<action method="addJs"> 
<script>varien/configurable.js</script> 
</action> 
</reference> 
</catalog_product_view>
Javascript delivery - grouping js 
Product page JS 
<script src="....3c5329efd2e437592d48e1a3a4eac5b1.js"></script>
Javascript delivery - grouping js 
Homepage JS 
<script src="....ebbc8820d00736a6f2402ff7b21567b2.js"></script> 100KB 
Product page JS 
<script src="....3c5329efd2e437592d48e1a3a4eac5b1.js"></script> 120KB
Javascript delivery - grouping js 
<default> 
<reference name="head"> 
<action method="addJs"> 
<script>prototype/prototype.js</script> 
<params>data-group="main"</params> 
</action> 
. . . 
. . . 
<action method="addJs"> 
<script>scriptaculous/builder.js</script> 
<params>data-group="main"</params> 
</action> 
</reference> 
</default>
Javascript delivery - grouping js 
Homepage JS 
<script src="....ebbc8820d00736a6f2402ff7b21567b2.js" data-group="main"> - 100Kb 
Product page JS 
<script src="....ebbc8820d00736a6f2402ff7b21567b2.js" data-group="main"> - cached 
<script src="....3c5329efd2e437592d48e1a3a4eac5b1.js"> - 20Kb
Javascript delivery - defer js 
<action method="addJs"> 
<script>prototype/prototype.js</script> 
<params>data-group="main" defer</params> 
</action>
Javascript delivery - defer js 
<script type="text/javascript"> 
document.addEventListener( "DOMContentLoaded", function(){ 
Mage.Cookies.path = '<?php echo $this->getPath()?>'; 
Mage.Cookies.domain = '<?php echo $this->getDomain()?>'; 
}, false ); 
</script>
Load time: 2.66s 
Start render: 1.3s 
Visually Complete: 2.8s 
Speed index: 2223
Font serving 
● Choose fallback font wisely 
● Prepare for failure - style fallback font 
● Don’t block rendering 
● Minimize FOUT 
● Store Base64 encoded font in local storage
Font serving 
/** Pseudocode **/ 
if (fonts_in_localStorage) { 
inject cached Font style sheet 
} else { 
// Don't block the loading of the page; 
on(window, "load", function() { 
load webfont.css 
store fonts_in_localStorage 
}); 
} 
Script: https://gist.github.com/
Load time: 1.8s 
Start render: 1.29s 
Visually Complete: 2.3s 
Speed index: 1746
Images delivery 
● Don’t waste user’s bandwidth 
● Load image when needed: “Lazy loading” 
● Load images based on screen size and pixel density: 
“Responsive images”
Images delivery 
<img 
class="lazy" 
src="default_image_url/loader" 
data-small = "small_image_url" 
data-big = "big_image_url" 
alt="" 
/>
Images delivery 
/** Pseudocode **/ 
if (image_is_on_screen) { 
if (resolution < 500px) && (pixel_density < 2 ) { 
show small image 
} else { 
show big image 
} 
} 
Script: echo.js
Load time: 1.50s 
Start render: 1.29s 
Visually Complete: 2.2s 
Speed index: 1653
CSS delivery 
● Start rendering early 
● Inline Critical CSS 
● Merge external CSS files 
● Defer loading of non-critical CSS
CSS delivery - inline critical CSS 
critical styles 
non-critical styles
CSS delivery - inline critical CSS 
/** Pseudocode **/ 
if (cssLoaded_cookie_exists) { 
Load CSS normally 
} else { 
<style> 
inject_critical_css 
</style> 
Load non-critical CSS async 
set cssLoaded cookie 
}); 
} 
Script: loadCSS
CSS delivery - critical CSS 
SCSS 
_account.scss 
_breadcrumbs.scss 
_buttons.scss 
_cart.scss 
_checkout.scss 
_footer.scss 
_forms.scss 
_header.scss 
_global.scss 
_navigation.scss 
_search.scss 
. . . 
. . . 
styles.scss styles.css
CSS delivery - critical CSS 
SCSS 
_account.scss 
_breadcrumbs.scss 
_buttons.scss 
_cart.scss 
_checkout.scss 
_footer.scss 
_forms.scss 
_header.scss 
_global.scss 
_navigation.scss 
_search.scss 
. . . 
. . . 
critical.scss critical.css
Load time: 1.55s 
Start render: 0.7s 
Visually Complete: 2.1s 
Speed index: 1547
Load time: 1.55s 
Start render: 0.7s 
Visually Complete: 2.1s 
Speed index: 1547 
Load time: 2.85s 
Start render: 2.95s 
Visually Complete: 3.1s 
Speed index: 3060
Takeaways: 
1. Performance matters
Takeaways: 
1. Performance matters 
2. Treat performance as a part of UX
Takeaways: 
1. Performance matters 
2. Treat performance as a part of UX 
3. Set performance budget
Takeaways: 
1. Performance matters 
2. Treat performance as a part of UX 
3. Set performance budget 
4. Optimize
Takeaways: 
1. Performance matters 
2. Treat performance as a part of UX 
3. Set performance budget 
4. Optimize 
5. RWD is NOT bad for performance!
Thank you 
Presentation: http://goo.gl/H0aNIc

Mais conteúdo relacionado

Mais procurados

SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...Distilled
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceNicholas Zakas
 
Increase Your WordPress Website's Google PageSpeed Score
Increase Your WordPress Website's Google PageSpeed ScoreIncrease Your WordPress Website's Google PageSpeed Score
Increase Your WordPress Website's Google PageSpeed ScoreBrainspire Solutions
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015dmethvin
 
GTM container positions: a summary of best & worst
GTM container positions: a summary of best & worstGTM container positions: a summary of best & worst
GTM container positions: a summary of best & worstPhil Pearce
 
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015beyond tellerrand
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web DesignChristopher Schmitt
 
Implementing a Responsive Image Strategy
Implementing a Responsive Image StrategyImplementing a Responsive Image Strategy
Implementing a Responsive Image StrategyChris Love
 
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014Bastian Grimm
 
How fast are we going now?
How fast are we going now?How fast are we going now?
How fast are we going now?Steve Souders
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015Matt Raible
 
Service workers your applications never felt so good
Service workers   your applications never felt so goodService workers   your applications never felt so good
Service workers your applications never felt so goodChris Love
 
What does the browser pre-loader do?
What does the browser pre-loader do?What does the browser pre-loader do?
What does the browser pre-loader do?Andy Davies
 
Web 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesWeb 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesSteve Souders
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...David Kaneda
 
Web Performance 101
Web Performance 101Web Performance 101
Web Performance 101Uri Lavi
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slowdmethvin
 

Mais procurados (20)

SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
 
HTML5
HTML5HTML5
HTML5
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
 
Increase Your WordPress Website's Google PageSpeed Score
Increase Your WordPress Website's Google PageSpeed ScoreIncrease Your WordPress Website's Google PageSpeed Score
Increase Your WordPress Website's Google PageSpeed Score
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015
 
GTM container positions: a summary of best & worst
GTM container positions: a summary of best & worstGTM container positions: a summary of best & worst
GTM container positions: a summary of best & worst
 
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
 
Implementing a Responsive Image Strategy
Implementing a Responsive Image StrategyImplementing a Responsive Image Strategy
Implementing a Responsive Image Strategy
 
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
 
Speed Index, explained!
Speed Index, explained!Speed Index, explained!
Speed Index, explained!
 
How fast are we going now?
How fast are we going now?How fast are we going now?
How fast are we going now?
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015
 
Service workers your applications never felt so good
Service workers   your applications never felt so goodService workers   your applications never felt so good
Service workers your applications never felt so good
 
What does the browser pre-loader do?
What does the browser pre-loader do?What does the browser pre-loader do?
What does the browser pre-loader do?
 
Web 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesWeb 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web Sites
 
Keep the Web Fast
Keep the Web FastKeep the Web Fast
Keep the Web Fast
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
 
Web Performance 101
Web Performance 101Web Performance 101
Web Performance 101
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slow
 

Destaque

Seeking a center of gravity in Magento's eCommerce Community. Kurt Theobald
Seeking a center of gravity in Magento's eCommerce Community. Kurt TheobaldSeeking a center of gravity in Magento's eCommerce Community. Kurt Theobald
Seeking a center of gravity in Magento's eCommerce Community. Kurt TheobaldMeetMagentoNY2014
 
The master chef lesson. Luz De-León
The master chef lesson. Luz De-LeónThe master chef lesson. Luz De-León
The master chef lesson. Luz De-LeónMeetMagentoNY2014
 
Deryck harlick presentation mmny14
Deryck harlick presentation mmny14Deryck harlick presentation mmny14
Deryck harlick presentation mmny14MeetMagentoNY2014
 
Two approaches to RWD: Pure & Hybrid. Brendan Falkowski
Two approaches to RWD: Pure & Hybrid. Brendan Falkowski Two approaches to RWD: Pure & Hybrid. Brendan Falkowski
Two approaches to RWD: Pure & Hybrid. Brendan Falkowski MeetMagentoNY2014
 
Magento Community. Ben Marks
Magento Community. Ben MarksMagento Community. Ben Marks
Magento Community. Ben MarksMeetMagentoNY2014
 
Customer acquisition through gifting. Monika kochhar
Customer acquisition through gifting. Monika kochharCustomer acquisition through gifting. Monika kochhar
Customer acquisition through gifting. Monika kochharMeetMagentoNY2014
 
Sospeso for street food
Sospeso for street foodSospeso for street food
Sospeso for street foodIsabel Theoret
 
The forgotten heart of Magento. Empowering End Users. Deryck harlick
The forgotten heart of Magento. Empowering End Users. Deryck harlickThe forgotten heart of Magento. Empowering End Users. Deryck harlick
The forgotten heart of Magento. Empowering End Users. Deryck harlickMeetMagentoNY2014
 
Conversion rate optimisation. What's realluy proved to matter? Viacheslav kra...
Conversion rate optimisation. What's realluy proved to matter? Viacheslav kra...Conversion rate optimisation. What's realluy proved to matter? Viacheslav kra...
Conversion rate optimisation. What's realluy proved to matter? Viacheslav kra...MeetMagentoNY2014
 
Transforming retail into me-tail. Jonny Dixon
Transforming retail into me-tail. Jonny DixonTransforming retail into me-tail. Jonny Dixon
Transforming retail into me-tail. Jonny DixonMeetMagentoNY2014
 
What we learned from travelling around the world: Meet Magento international....
What we learned from travelling around the world: Meet Magento international....What we learned from travelling around the world: Meet Magento international....
What we learned from travelling around the world: Meet Magento international....MeetMagentoNY2014
 
CRM and Ecommerce. Yoav Kutner
CRM and Ecommerce. Yoav Kutner CRM and Ecommerce. Yoav Kutner
CRM and Ecommerce. Yoav Kutner MeetMagentoNY2014
 
Magento on HHVM. Daniel Sloof
Magento on HHVM. Daniel SloofMagento on HHVM. Daniel Sloof
Magento on HHVM. Daniel SloofMeetMagentoNY2014
 
Definisi & penalaran
Definisi & penalaranDefinisi & penalaran
Definisi & penalaranAsrinY
 
Leveraging innovation in herbal formulations and cosmetics: Whitestone Healt...
Leveraging innovation  in herbal formulations and cosmetics: Whitestone Healt...Leveraging innovation  in herbal formulations and cosmetics: Whitestone Healt...
Leveraging innovation in herbal formulations and cosmetics: Whitestone Healt...Whitestone Healthcare
 
Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent MeetMagentoNY2014
 
iOsikko(仮)企画書
iOsikko(仮)企画書iOsikko(仮)企画書
iOsikko(仮)企画書team_osikko
 
CRM for Ecommerce. Jary Carter
CRM for Ecommerce. Jary CarterCRM for Ecommerce. Jary Carter
CRM for Ecommerce. Jary CarterMeetMagentoNY2014
 

Destaque (18)

Seeking a center of gravity in Magento's eCommerce Community. Kurt Theobald
Seeking a center of gravity in Magento's eCommerce Community. Kurt TheobaldSeeking a center of gravity in Magento's eCommerce Community. Kurt Theobald
Seeking a center of gravity in Magento's eCommerce Community. Kurt Theobald
 
The master chef lesson. Luz De-León
The master chef lesson. Luz De-LeónThe master chef lesson. Luz De-León
The master chef lesson. Luz De-León
 
Deryck harlick presentation mmny14
Deryck harlick presentation mmny14Deryck harlick presentation mmny14
Deryck harlick presentation mmny14
 
Two approaches to RWD: Pure & Hybrid. Brendan Falkowski
Two approaches to RWD: Pure & Hybrid. Brendan Falkowski Two approaches to RWD: Pure & Hybrid. Brendan Falkowski
Two approaches to RWD: Pure & Hybrid. Brendan Falkowski
 
Magento Community. Ben Marks
Magento Community. Ben MarksMagento Community. Ben Marks
Magento Community. Ben Marks
 
Customer acquisition through gifting. Monika kochhar
Customer acquisition through gifting. Monika kochharCustomer acquisition through gifting. Monika kochhar
Customer acquisition through gifting. Monika kochhar
 
Sospeso for street food
Sospeso for street foodSospeso for street food
Sospeso for street food
 
The forgotten heart of Magento. Empowering End Users. Deryck harlick
The forgotten heart of Magento. Empowering End Users. Deryck harlickThe forgotten heart of Magento. Empowering End Users. Deryck harlick
The forgotten heart of Magento. Empowering End Users. Deryck harlick
 
Conversion rate optimisation. What's realluy proved to matter? Viacheslav kra...
Conversion rate optimisation. What's realluy proved to matter? Viacheslav kra...Conversion rate optimisation. What's realluy proved to matter? Viacheslav kra...
Conversion rate optimisation. What's realluy proved to matter? Viacheslav kra...
 
Transforming retail into me-tail. Jonny Dixon
Transforming retail into me-tail. Jonny DixonTransforming retail into me-tail. Jonny Dixon
Transforming retail into me-tail. Jonny Dixon
 
What we learned from travelling around the world: Meet Magento international....
What we learned from travelling around the world: Meet Magento international....What we learned from travelling around the world: Meet Magento international....
What we learned from travelling around the world: Meet Magento international....
 
CRM and Ecommerce. Yoav Kutner
CRM and Ecommerce. Yoav Kutner CRM and Ecommerce. Yoav Kutner
CRM and Ecommerce. Yoav Kutner
 
Magento on HHVM. Daniel Sloof
Magento on HHVM. Daniel SloofMagento on HHVM. Daniel Sloof
Magento on HHVM. Daniel Sloof
 
Definisi & penalaran
Definisi & penalaranDefinisi & penalaran
Definisi & penalaran
 
Leveraging innovation in herbal formulations and cosmetics: Whitestone Healt...
Leveraging innovation  in herbal formulations and cosmetics: Whitestone Healt...Leveraging innovation  in herbal formulations and cosmetics: Whitestone Healt...
Leveraging innovation in herbal formulations and cosmetics: Whitestone Healt...
 
Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent Magento 2 overview. Alan Kent
Magento 2 overview. Alan Kent
 
iOsikko(仮)企画書
iOsikko(仮)企画書iOsikko(仮)企画書
iOsikko(仮)企画書
 
CRM for Ecommerce. Jary Carter
CRM for Ecommerce. Jary CarterCRM for Ecommerce. Jary Carter
CRM for Ecommerce. Jary Carter
 

Semelhante a Build Better Responsive websites. Hrvoje Jurišić

Progressive downloads and rendering (Stoyan Stefanov)
Progressive downloads and rendering (Stoyan Stefanov)Progressive downloads and rendering (Stoyan Stefanov)
Progressive downloads and rendering (Stoyan Stefanov)Ontico
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and RenderingStoyan Stefanov
 
Website Performance Basics
Website Performance BasicsWebsite Performance Basics
Website Performance Basicsgeku
 
Enough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas ZakasEnough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas ZakasKubide
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!Nicholas Zakas
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 201210 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 2012Bastian Grimm
 
Bringing the JAMstack to the Enterprise
Bringing the JAMstack to the EnterpriseBringing the JAMstack to the Enterprise
Bringing the JAMstack to the EnterpriseJamund Ferguson
 
NYC WebPerf Meetup Feb 2020 - Measuring the Adoption of Web Performance Techn...
NYC WebPerf Meetup Feb 2020 - Measuring the Adoption of Web Performance Techn...NYC WebPerf Meetup Feb 2020 - Measuring the Adoption of Web Performance Techn...
NYC WebPerf Meetup Feb 2020 - Measuring the Adoption of Web Performance Techn...Paul Calvano
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)Steve Souders
 
JavaScript Perfomance
JavaScript PerfomanceJavaScript Perfomance
JavaScript PerfomanceAnatol Alizar
 
Faster Frontends
Faster FrontendsFaster Frontends
Faster FrontendsAndy Davies
 
建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版Joseph Chiang
 
High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)Steve Souders
 
Client Side Optimization
Client Side OptimizationClient Side Optimization
Client Side OptimizationPatrick Huesler
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingAshok Modi
 
High performance website
High performance websiteHigh performance website
High performance websiteChamnap Chhorn
 
Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontendtkramar
 

Semelhante a Build Better Responsive websites. Hrvoje Jurišić (20)

Progressive downloads and rendering (Stoyan Stefanov)
Progressive downloads and rendering (Stoyan Stefanov)Progressive downloads and rendering (Stoyan Stefanov)
Progressive downloads and rendering (Stoyan Stefanov)
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and Rendering
 
Website Performance Basics
Website Performance BasicsWebsite Performance Basics
Website Performance Basics
 
Enough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas ZakasEnough with the javas cript already! de Nicholas Zakas
Enough with the javas cript already! de Nicholas Zakas
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!
 
Please dont touch-3.6-jsday
Please dont touch-3.6-jsdayPlease dont touch-3.6-jsday
Please dont touch-3.6-jsday
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 201210 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
 
Bringing the JAMstack to the Enterprise
Bringing the JAMstack to the EnterpriseBringing the JAMstack to the Enterprise
Bringing the JAMstack to the Enterprise
 
NYC WebPerf Meetup Feb 2020 - Measuring the Adoption of Web Performance Techn...
NYC WebPerf Meetup Feb 2020 - Measuring the Adoption of Web Performance Techn...NYC WebPerf Meetup Feb 2020 - Measuring the Adoption of Web Performance Techn...
NYC WebPerf Meetup Feb 2020 - Measuring the Adoption of Web Performance Techn...
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
 
JavaScript Perfomance
JavaScript PerfomanceJavaScript Perfomance
JavaScript Perfomance
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Faster Frontends
Faster FrontendsFaster Frontends
Faster Frontends
 
建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版
 
High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)High Performance Mobile (SF/SV Web Perf)
High Performance Mobile (SF/SV Web Perf)
 
Web performance tuning
Web performance tuning Web performance tuning
Web performance tuning
 
Client Side Optimization
Client Side OptimizationClient Side Optimization
Client Side Optimization
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
 
High performance website
High performance websiteHigh performance website
High performance website
 
Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
 

Último

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

Build Better Responsive websites. Hrvoje Jurišić

  • 1. Build better responsive websites Hrvoje Jurišić, Inchoo
  • 2.
  • 5. Users expect 2 seconds Source: akamai.com
  • 6. After 3 seconds 40% will leave Source: akamai.com
  • 7. 88% of customers will never come back Source: gomez.com
  • 8. 1 second delay 7% less conversions Source: tagman.com
  • 9. Amazon: 100 ms latency 1% less revenue Source: highscalability.com
  • 11. 2013 load time: 7.2s 2014 load time: 10.7s Source: http://www.radware.com/
  • 12. 2013: 1007 KB 2014: 1677 KB Source: http://www.radware.com/
  • 14.
  • 15. 55% of eCommerce traffic happens on mobile device Source: webperformancetoday.com
  • 16. Mobile users expect sites to load as fast or even faster than on their desktops Source: strangeloopnetworks.com
  • 17. Meet Magento New York 2014 @hrvojejurisic
  • 18. 4G to the rescue??
  • 23.
  • 24. Source: guypo.com Page Size Smallest resolution vs Biggest resolution
  • 26. RWD is bad for performance!
  • 27. 6% of RWD sites done right
  • 28.
  • 29. RWD is bad for performance!
  • 30. RWD is bad for performance! Blame the implementation, not the technique
  • 31.
  • 32. Speed is a feature treat it as a part of UX design
  • 33. Mobile first, content out workflow Source: http://www.lukew.com
  • 34. Set a performance budget Source: http://timkadlec.com
  • 35.
  • 38. Foundations: 1. Reduce http requests
  • 39. Foundations: 1. Reduce http requests ● Use CSS sprites ● Use icon fonts ● Merge javascript ● Merge CSS
  • 40. Foundations: 1. Reduce http requests 2. Gzip components
  • 41. Foundations: 1. Reduce http requests 2. Gzip components 3. Minify JS and CSS
  • 42. Foundations: 1. Reduce http requests 2. Gzip components 3. Minify JS and CSS 4. Optimize images
  • 43. Foundations: 1. Reduce http requests 2. Gzip components 3. Minify JS and CSS 4. Optimize images 5. CSS at the top
  • 44. Foundations: 1. Reduce http requests 2. Gzip components 3. Minify JS and CSS 4. Optimize images 5. CSS at the top 6. JS at the bottom or async
  • 45. Foundations: 1. Reduce http requests 2. Gzip components 3. Minify JS and CSS 4. Optimize images 5. CSS at the top 6. JS at the bottom or async 7. Use CDN
  • 46.
  • 47. Tools 1. Firebug/Web inspector 2. webpagetest.org 3. Google PageSpeed
  • 48. Case study: Load time: 2.85s Start render: 2.95s Visually Complete: 3.1s Speed index: 3060
  • 49. Javascript delivery ● Merge JS files ● Don’t block rendering
  • 50. Javascript delivery - grouping js <default> <reference name="head"> <action method="addJs"> <script>prototype/prototype.js</script> </action> . . . . . . . . . <action method="addJs"> <script>scriptaculous/builder.js</script> </action> </reference> </default>
  • 51. Javascript delivery - grouping js Homepage JS <script src="....ebbc8820d00736a6f2402ff7b21567b2.js"></script>
  • 52. Javascript delivery - grouping js <catalog_product_view> <reference name="head"> <action method="addJs"> <script>varien/product.js</script> </action> <action method="addJs"> <script>varien/configurable.js</script> </action> </reference> </catalog_product_view>
  • 53. Javascript delivery - grouping js Product page JS <script src="....3c5329efd2e437592d48e1a3a4eac5b1.js"></script>
  • 54. Javascript delivery - grouping js Homepage JS <script src="....ebbc8820d00736a6f2402ff7b21567b2.js"></script> 100KB Product page JS <script src="....3c5329efd2e437592d48e1a3a4eac5b1.js"></script> 120KB
  • 55. Javascript delivery - grouping js <default> <reference name="head"> <action method="addJs"> <script>prototype/prototype.js</script> <params>data-group="main"</params> </action> . . . . . . <action method="addJs"> <script>scriptaculous/builder.js</script> <params>data-group="main"</params> </action> </reference> </default>
  • 56. Javascript delivery - grouping js Homepage JS <script src="....ebbc8820d00736a6f2402ff7b21567b2.js" data-group="main"> - 100Kb Product page JS <script src="....ebbc8820d00736a6f2402ff7b21567b2.js" data-group="main"> - cached <script src="....3c5329efd2e437592d48e1a3a4eac5b1.js"> - 20Kb
  • 57. Javascript delivery - defer js <action method="addJs"> <script>prototype/prototype.js</script> <params>data-group="main" defer</params> </action>
  • 58. Javascript delivery - defer js <script type="text/javascript"> document.addEventListener( "DOMContentLoaded", function(){ Mage.Cookies.path = '<?php echo $this->getPath()?>'; Mage.Cookies.domain = '<?php echo $this->getDomain()?>'; }, false ); </script>
  • 59. Load time: 2.66s Start render: 1.3s Visually Complete: 2.8s Speed index: 2223
  • 60. Font serving ● Choose fallback font wisely ● Prepare for failure - style fallback font ● Don’t block rendering ● Minimize FOUT ● Store Base64 encoded font in local storage
  • 61. Font serving /** Pseudocode **/ if (fonts_in_localStorage) { inject cached Font style sheet } else { // Don't block the loading of the page; on(window, "load", function() { load webfont.css store fonts_in_localStorage }); } Script: https://gist.github.com/
  • 62. Load time: 1.8s Start render: 1.29s Visually Complete: 2.3s Speed index: 1746
  • 63. Images delivery ● Don’t waste user’s bandwidth ● Load image when needed: “Lazy loading” ● Load images based on screen size and pixel density: “Responsive images”
  • 64. Images delivery <img class="lazy" src="default_image_url/loader" data-small = "small_image_url" data-big = "big_image_url" alt="" />
  • 65. Images delivery /** Pseudocode **/ if (image_is_on_screen) { if (resolution < 500px) && (pixel_density < 2 ) { show small image } else { show big image } } Script: echo.js
  • 66. Load time: 1.50s Start render: 1.29s Visually Complete: 2.2s Speed index: 1653
  • 67. CSS delivery ● Start rendering early ● Inline Critical CSS ● Merge external CSS files ● Defer loading of non-critical CSS
  • 68. CSS delivery - inline critical CSS critical styles non-critical styles
  • 69. CSS delivery - inline critical CSS /** Pseudocode **/ if (cssLoaded_cookie_exists) { Load CSS normally } else { <style> inject_critical_css </style> Load non-critical CSS async set cssLoaded cookie }); } Script: loadCSS
  • 70. CSS delivery - critical CSS SCSS _account.scss _breadcrumbs.scss _buttons.scss _cart.scss _checkout.scss _footer.scss _forms.scss _header.scss _global.scss _navigation.scss _search.scss . . . . . . styles.scss styles.css
  • 71. CSS delivery - critical CSS SCSS _account.scss _breadcrumbs.scss _buttons.scss _cart.scss _checkout.scss _footer.scss _forms.scss _header.scss _global.scss _navigation.scss _search.scss . . . . . . critical.scss critical.css
  • 72. Load time: 1.55s Start render: 0.7s Visually Complete: 2.1s Speed index: 1547
  • 73. Load time: 1.55s Start render: 0.7s Visually Complete: 2.1s Speed index: 1547 Load time: 2.85s Start render: 2.95s Visually Complete: 3.1s Speed index: 3060
  • 75. Takeaways: 1. Performance matters 2. Treat performance as a part of UX
  • 76. Takeaways: 1. Performance matters 2. Treat performance as a part of UX 3. Set performance budget
  • 77. Takeaways: 1. Performance matters 2. Treat performance as a part of UX 3. Set performance budget 4. Optimize
  • 78. Takeaways: 1. Performance matters 2. Treat performance as a part of UX 3. Set performance budget 4. Optimize 5. RWD is NOT bad for performance!
  • 79. Thank you Presentation: http://goo.gl/H0aNIc