SlideShare a Scribd company logo
Web Performance Optimization
for Modern Web Applications
Chris Love

@ChrisLove

ProfessionalASPNET.com
Slide Deck & Source Code

Slide Deck – http://slidesha.re/SzoqKs
Source Code – http://GitHub.com/docluv
Web Performance Optimization Resources

High Performance Web Sites - http://bitly.com/U7GStY
Even Faster Web Sites - http://amzn.to/WTiDFM
Web Performance Daybook - http://amzn.to/VV4Grz
High Performance JavaScript - http://amzn.to/Sq9IFC
Steve Souders - http://www.stevesouders.com/
Web performance optimization, WPO, or website
               optimization involves ongoing monitoring and
Web            testing of websites to achieve optimum

Performance    performance under given constraints. Usually
               optimization is restricted due to lack of complete
Optimization   information and metrics to evaluate the
               performance of a website.




                                             http://bit.ly/SWEh6E
"Also take a step back for a minute and consider
             the intent of this change: a faster web is great for
             everyone, but especially for users. Lots of
             websites have demonstrated that speeding up the
Matt Cutts   user experience results in more usage. So
             speeding up your website isn’t just something that
             can affect your search rankings–it’s a fantastic
             idea for your users."



                                             http://bit.ly/SPPB4k
Time === $$$$

Faster Sites Have Higher Conversion Rates




WalMart - http://bit.ly/S1fHSZ
Google – http://bit.ly/WajJbB
Amazon – http://bit.ly/S3UoAj
ShopZilla - http://bit.ly/RIQMDM
Folks at Walmart knew their pages were slow. As a for
          instance, initial measurement showed that an item page
          took about 24 seconds to load for the slowest 5% of users.

WalMart   Why? The usual culprits: too many page elements, slow
          third-party scripts, multiple hosts (25% of page content is
          served by partners, affiliates, and Marketplace), and various
          best practice no-nos




          http://bit.ly/WajJbB
Web performance optimization for modern web applications
Web performance optimization for modern web applications
Half a second delay caused a 20% drop in traffic.
½ Second   Half a second delay killed user satisfaction.


Delay      The lesson, Marissa said, is that speed matters.
           People do not like to wait. Do not make them.




           http://bit.ly/TPPhUp
WPO Fast Facts


 • 57% Will Abandon a Slow Site After 3 Seconds
 • We Have to Concentrate 50% Harder For Slow Sites
 • 78% Have Felt Stress or Anger With Slow Sites
 • 44% Say Slow Sites Make Them Anxious
 • 4% Have Thrown Their Phone



                                                   http://bit.ly/SuBLDR
Web Sites/Apps Are Getting Larger

86 Files Requests         53 Images
1.25MB                    750KB
15 JavaScript Files       14 Domains
214KB



                        http://bit.ly/PVlLOC
Web Sites/Apps Are Getting Larger
We Are Getting More Mobile
Assume Everyone is on Sprint 3G




                                  http://bit.ly/WebIqD
And Is Using Android




                       http://bit.ly/ZGMm4A
YSlow Rules

1. Minimize HTTP Requests                     13. Remove Duplicate Scripts
2. Use a Content Delivery Network             14. Configure ETags
3. Avoid empty src or href                    15. Make AJAX Cacheable
4. Add an Expires or a Cache-Control Header   16. Use GET for AJAX Requests
5. Gzip Components                            17. Reduce the Number of DOM Elements
6. Put StyleSheets at the Top                 18. No 404s
7. Put Scripts at the Bottom                  19. Reduce Cookie Size
8. Avoid CSS Expressions                      20. Use Cookie-Free Domains for Components
9. Make JavaScript and CSS External           21. Avoid Filters
10. Reduce DNS Lookups                        22. Do Not Scale Images in HTML
11. Minify JavaScript and CSS                 23. Make favicon.ico Small and Cacheable
12. Avoid Redirects


                                              http://yhoo.it/W7BFIw
YSlow Rules – That Will Play A Part Today 

1. Minimize HTTP Requests                     13.Remove Duplicate Scripts
2. Use a Content Delivery Network             14. Configure ETags
3. Avoid empty src or href                    15. Make AJAX Cacheable
4. Add an Expires or a Cache-Control Header   16. Use GET for AJAX Requests
5. Gzip Components                            17.Reduce the Number of DOM Elements
6. Put StyleSheets at the Top                 18.No 404s
7. Put Scripts at the Bottom                  19.Reduce Cookie Size
8. Avoid CSS Expressions                      20.Use Cookie-Free Domains for Components
9. Make JavaScript and CSS External           21. Avoid Filters
10.Reduce DNS Lookups                         22. Do Not Scale Images in HTML
11.Minify JavaScript and CSS                  23.Make favicon.ico Small and Cacheable
12. Avoid Redirects


                                              http://yhoo.it/W7BFIw
“Most of your scaling problems wont be
Mike Krieger   glamorous"




                                           http://bit.ly/QeKZsO
Make FavIcon Small and Cacheable

Don’t Return 404

Make Sure Its Compatible

       PNG/ICO

It Carries Cookie Weight



Instagram Lesson #1

http://bit.ly/RUXEiL
Speaking Of Cookies

 • Cookies Add Weight

 • Place Resources (img/css/js) on
   Cookieless Domains

 • Consider Local Storage Instead
Impact of Cookies on Response Time
Use LocalStorage For Storage & Caching

• Allows You to Keep Data Locally in a Hash Table
   • localStorage
   • sessionStorage
• Approximately 5MB
• Replace Cookies
• Great For Caching
Let’s Examine Southwest.com
                       • 95 File Requests
                       • 6 Domains
                       • 2 CSS
                       • 17 Documents
                       • 49 Images
                       • 30 JavaScript Files
                       • 4 AJAX Calls
                       • 786 KB – 1.25MB
                       • 2042 KB Request Header
                       • 16.5KB Cookie
                       • 1430 DOM Elements
Combine 19 JavaScript Files
Combine 19 JavaScript Files

 • Eliminated 18 file Requests

 • 42.6KB Header Data

 • Eliminated 18 Gzip Decompress
   Operations

 • Probably Shave ~ 1 Second
Southwest.com Page Structure

 <meta http-equiv="X-UA-Compatible"       content="IE=EmulateIE7"/>

 <link rel="shortcut icon" href="/assets/images/favicon.ico"/>

 <style> … </style>

 <script> … </script> - 22 Times

 Script References in the HEAD – Should be at the Bottom
Southwest.com Improvements

 Over the past few months I have been analyzing
 Southwest.com and have seen some tremendous
 improvements. Data transfer size has been cut in half
 this week alone. I have seen the complete load time
 reduced around 2 seconds in the past few weeks. The
 number of file requests has been reduced. So many be
 we will be privileged to a new WPO case study soon ;)
Let’s Look at Some Code!
Asynchronous Script Loading

  • Allows You to lazy Load Scripts
  • Great Way to Isolate 3rd Party Scripts
  • Helps Avoid Single Points of Failure

  •   Check For Existing Script Reference
  •   Creates New Element
  •   Executes a Callback When the Document is loaded
  •   Appends the Script to the BODY

                                             http://bit.ly/TKdo6C
Image Optimization Tricks

 • CSS Sprites

 • Data URIs

       <img src="data:image/png;base64,iVBORw0KGHAAAD…Zw4PIXZORK5CYII="/>


 • CSS3 Features

       • Rounded Corners

       • Gradients
Use Native Selectors Instead of jQuery




                             http://bit.ly/S0bwby
Optimize CSS

• Good Structure
    • Size

    • Colors

    • Views/Controls

    • Languages


• Avoid ID References #

More Related Content

PPTX
10 things you can do to speed up your web app today stir trek edition
PPTX
10 Things You Can Do to Speed Up Your Web App Today
PDF
JS in Rural Communities
PDF
State of the Web
PDF
Technical SEO for WordPress - 2019 edition
PPTX
Web Performance 101
PDF
Optimizing web performance (Fronteers edition)
PPTX
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today stir trek edition
10 Things You Can Do to Speed Up Your Web App Today
JS in Rural Communities
State of the Web
Technical SEO for WordPress - 2019 edition
Web Performance 101
Optimizing web performance (Fronteers edition)
10 things you can do to speed up your web app today 2016

What's hot (20)

PPTX
Building Faster Websites
KEY
API Best Practices
PDF
WordPress Theme Performance - WP Vienna meetup 8.6.2016
PPT
Fast and Easy Website Tuneups
PDF
PPTX
Html5 Fit: Get Rid of Love Handles
PPTX
Advanced front end debugging with ms edge and ms tools
PDF
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
PDF
Build Better Responsive websites. Hrvoje Jurišić
PPTX
What is HTML 5?
PDF
SEO AJAX Crawlability in a Responsive Publisher World
PPTX
Develop a vanilla.js spa you and your customers will love
PDF
Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...
PPTX
DeepCrawl Webinar: Performing SEO on the Edge
PPTX
JavaScript front end performance optimizations
PPTX
Service workers your applications never felt so good
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
PDF
17 Web Performance Metrics You Should Care About
PPTX
That's crazy! how to build single page web apps
PPTX
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
Building Faster Websites
API Best Practices
WordPress Theme Performance - WP Vienna meetup 8.6.2016
Fast and Easy Website Tuneups
Html5 Fit: Get Rid of Love Handles
Advanced front end debugging with ms edge and ms tools
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
Build Better Responsive websites. Hrvoje Jurišić
What is HTML 5?
SEO AJAX Crawlability in a Responsive Publisher World
Develop a vanilla.js spa you and your customers will love
Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...
DeepCrawl Webinar: Performing SEO on the Edge
JavaScript front end performance optimizations
Service workers your applications never felt so good
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
17 Web Performance Metrics You Should Care About
That's crazy! how to build single page web apps
BrightonSEO 2019 - Edge SEO - Using CDNs To Perform SEO On The Edge
Ad

Similar to Web performance optimization for modern web applications (20)

PPTX
Performace optimization (increase website speed)
PDF
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
PDF
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
PDF
High Performance Websites
PPTX
Breaking the Speed Limit: Faster Websites Win
PPT
Frontend performance
PDF
Performance tuning of Websites
PDF
High performance website
KEY
Faster Frontends
PDF
7 Habits of Exceptional Performance
PDF
A little journey into website optimization
PPTX
Website Performance
PDF
A Look at the Performance of SAP's Modern UIs
PPTX
Optimizing website performance
PDF
PDF
Velocity wpo-20101207 stevesouders
PDF
Velocity WPO 20101207 steve souders
PDF
Optimization
PDF
How to Take Your Website Beyond Fast
PDF
WPO Israel Meetup - Mobile Web Performance slides by Steve Souders
Performace optimization (increase website speed)
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
High Performance Websites
Breaking the Speed Limit: Faster Websites Win
Frontend performance
Performance tuning of Websites
High performance website
Faster Frontends
7 Habits of Exceptional Performance
A little journey into website optimization
Website Performance
A Look at the Performance of SAP's Modern UIs
Optimizing website performance
Velocity wpo-20101207 stevesouders
Velocity WPO 20101207 steve souders
Optimization
How to Take Your Website Beyond Fast
WPO Israel Meetup - Mobile Web Performance slides by Steve Souders
Ad

More from Chris Love (20)

PPTX
Quick Fetch API Introduction
PPTX
Introduction to Progressive Web Applications
PPTX
Introduction to Progressive Web Applications
PPTX
Lazy load Website Assets
PPTX
Progressive Web Apps for Education
PPTX
The server is dead going serverless to create a highly scalable application y...
PPTX
A Day Building Fast, Responsive, Extensible Single Page Applications
PPTX
Real World Lessons in Progressive Web Application & Service Worker Caching
PPTX
Disrupting the application eco system with progressive web applications
PPTX
Implementing a Responsive Image Strategy
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere
PPT
Css best practices style guide and tips
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere
PPTX
An Introduction to Microsoft Edge
PPTX
Single page applications the basics
PPTX
There Is No Mobile: An Introduction To Responsive Web Design
PPTX
Touch the web
PPTX
SPAs Are Easy
PPTX
A night at the spa
PPTX
Responsive web design
Quick Fetch API Introduction
Introduction to Progressive Web Applications
Introduction to Progressive Web Applications
Lazy load Website Assets
Progressive Web Apps for Education
The server is dead going serverless to create a highly scalable application y...
A Day Building Fast, Responsive, Extensible Single Page Applications
Real World Lessons in Progressive Web Application & Service Worker Caching
Disrupting the application eco system with progressive web applications
Implementing a Responsive Image Strategy
Using Responsive Web Design To Make Your Web Work Everywhere
Css best practices style guide and tips
Using Responsive Web Design To Make Your Web Work Everywhere
An Introduction to Microsoft Edge
Single page applications the basics
There Is No Mobile: An Introduction To Responsive Web Design
Touch the web
SPAs Are Easy
A night at the spa
Responsive web design

Web performance optimization for modern web applications

  • 1. Web Performance Optimization for Modern Web Applications Chris Love @ChrisLove ProfessionalASPNET.com
  • 2. Slide Deck & Source Code Slide Deck – http://slidesha.re/SzoqKs Source Code – http://GitHub.com/docluv
  • 3. Web Performance Optimization Resources High Performance Web Sites - http://bitly.com/U7GStY Even Faster Web Sites - http://amzn.to/WTiDFM Web Performance Daybook - http://amzn.to/VV4Grz High Performance JavaScript - http://amzn.to/Sq9IFC Steve Souders - http://www.stevesouders.com/
  • 4. Web performance optimization, WPO, or website optimization involves ongoing monitoring and Web testing of websites to achieve optimum Performance performance under given constraints. Usually optimization is restricted due to lack of complete Optimization information and metrics to evaluate the performance of a website. http://bit.ly/SWEh6E
  • 5. "Also take a step back for a minute and consider the intent of this change: a faster web is great for everyone, but especially for users. Lots of websites have demonstrated that speeding up the Matt Cutts user experience results in more usage. So speeding up your website isn’t just something that can affect your search rankings–it’s a fantastic idea for your users." http://bit.ly/SPPB4k
  • 6. Time === $$$$ Faster Sites Have Higher Conversion Rates WalMart - http://bit.ly/S1fHSZ Google – http://bit.ly/WajJbB Amazon – http://bit.ly/S3UoAj ShopZilla - http://bit.ly/RIQMDM
  • 7. Folks at Walmart knew their pages were slow. As a for instance, initial measurement showed that an item page took about 24 seconds to load for the slowest 5% of users. WalMart Why? The usual culprits: too many page elements, slow third-party scripts, multiple hosts (25% of page content is served by partners, affiliates, and Marketplace), and various best practice no-nos http://bit.ly/WajJbB
  • 10. Half a second delay caused a 20% drop in traffic. ½ Second Half a second delay killed user satisfaction. Delay The lesson, Marissa said, is that speed matters. People do not like to wait. Do not make them. http://bit.ly/TPPhUp
  • 11. WPO Fast Facts • 57% Will Abandon a Slow Site After 3 Seconds • We Have to Concentrate 50% Harder For Slow Sites • 78% Have Felt Stress or Anger With Slow Sites • 44% Say Slow Sites Make Them Anxious • 4% Have Thrown Their Phone http://bit.ly/SuBLDR
  • 12. Web Sites/Apps Are Getting Larger 86 Files Requests 53 Images 1.25MB 750KB 15 JavaScript Files 14 Domains 214KB http://bit.ly/PVlLOC
  • 13. Web Sites/Apps Are Getting Larger
  • 14. We Are Getting More Mobile
  • 15. Assume Everyone is on Sprint 3G http://bit.ly/WebIqD
  • 16. And Is Using Android http://bit.ly/ZGMm4A
  • 17. YSlow Rules 1. Minimize HTTP Requests 13. Remove Duplicate Scripts 2. Use a Content Delivery Network 14. Configure ETags 3. Avoid empty src or href 15. Make AJAX Cacheable 4. Add an Expires or a Cache-Control Header 16. Use GET for AJAX Requests 5. Gzip Components 17. Reduce the Number of DOM Elements 6. Put StyleSheets at the Top 18. No 404s 7. Put Scripts at the Bottom 19. Reduce Cookie Size 8. Avoid CSS Expressions 20. Use Cookie-Free Domains for Components 9. Make JavaScript and CSS External 21. Avoid Filters 10. Reduce DNS Lookups 22. Do Not Scale Images in HTML 11. Minify JavaScript and CSS 23. Make favicon.ico Small and Cacheable 12. Avoid Redirects http://yhoo.it/W7BFIw
  • 18. YSlow Rules – That Will Play A Part Today  1. Minimize HTTP Requests 13.Remove Duplicate Scripts 2. Use a Content Delivery Network 14. Configure ETags 3. Avoid empty src or href 15. Make AJAX Cacheable 4. Add an Expires or a Cache-Control Header 16. Use GET for AJAX Requests 5. Gzip Components 17.Reduce the Number of DOM Elements 6. Put StyleSheets at the Top 18.No 404s 7. Put Scripts at the Bottom 19.Reduce Cookie Size 8. Avoid CSS Expressions 20.Use Cookie-Free Domains for Components 9. Make JavaScript and CSS External 21. Avoid Filters 10.Reduce DNS Lookups 22. Do Not Scale Images in HTML 11.Minify JavaScript and CSS 23.Make favicon.ico Small and Cacheable 12. Avoid Redirects http://yhoo.it/W7BFIw
  • 19. “Most of your scaling problems wont be Mike Krieger glamorous" http://bit.ly/QeKZsO
  • 20. Make FavIcon Small and Cacheable Don’t Return 404 Make Sure Its Compatible PNG/ICO It Carries Cookie Weight Instagram Lesson #1 http://bit.ly/RUXEiL
  • 21. Speaking Of Cookies • Cookies Add Weight • Place Resources (img/css/js) on Cookieless Domains • Consider Local Storage Instead
  • 22. Impact of Cookies on Response Time
  • 23. Use LocalStorage For Storage & Caching • Allows You to Keep Data Locally in a Hash Table • localStorage • sessionStorage • Approximately 5MB • Replace Cookies • Great For Caching
  • 24. Let’s Examine Southwest.com • 95 File Requests • 6 Domains • 2 CSS • 17 Documents • 49 Images • 30 JavaScript Files • 4 AJAX Calls • 786 KB – 1.25MB • 2042 KB Request Header • 16.5KB Cookie • 1430 DOM Elements
  • 26. Combine 19 JavaScript Files • Eliminated 18 file Requests • 42.6KB Header Data • Eliminated 18 Gzip Decompress Operations • Probably Shave ~ 1 Second
  • 27. Southwest.com Page Structure <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/> <link rel="shortcut icon" href="/assets/images/favicon.ico"/> <style> … </style> <script> … </script> - 22 Times Script References in the HEAD – Should be at the Bottom
  • 28. Southwest.com Improvements Over the past few months I have been analyzing Southwest.com and have seen some tremendous improvements. Data transfer size has been cut in half this week alone. I have seen the complete load time reduced around 2 seconds in the past few weeks. The number of file requests has been reduced. So many be we will be privileged to a new WPO case study soon ;)
  • 29. Let’s Look at Some Code!
  • 30. Asynchronous Script Loading • Allows You to lazy Load Scripts • Great Way to Isolate 3rd Party Scripts • Helps Avoid Single Points of Failure • Check For Existing Script Reference • Creates New Element • Executes a Callback When the Document is loaded • Appends the Script to the BODY http://bit.ly/TKdo6C
  • 31. Image Optimization Tricks • CSS Sprites • Data URIs <img src="data:image/png;base64,iVBORw0KGHAAAD…Zw4PIXZORK5CYII="/> • CSS3 Features • Rounded Corners • Gradients
  • 32. Use Native Selectors Instead of jQuery http://bit.ly/S0bwby
  • 33. Optimize CSS • Good Structure • Size • Colors • Views/Controls • Languages • Avoid ID References #

Editor's Notes

  • #5: In Slide Show mode, click the arrow to enter the PowerPoint Getting Started Center.
  • #6: In Slide Show mode, click the arrow to enter the PowerPoint Getting Started Center.
  • #20: In Slide Show mode, click the arrow to enter the PowerPoint Getting Started Center.