SlideShare une entreprise Scribd logo
1  sur  55
10 Things You Can Do Today
To Speed Up Your Web
Application
Chris Love
@ChrisLove
Love2Dev.com
Who Am I
• ASP.NET MVP
• ASP Insider
• Internet Explorer User Agent
• Author
• Speaker
• Tweaker, Lover of Web, JavaScript, CSS & HTML5
• @ChrisLove
• Love2Dev.com
High Performance Single Page Web
Applications
• Responsive Design
• Touch
• Mobile First
• SPA
• Extensible, Scalable Architecture
• Web Build and Workflow
• Goes Really Fast!
• ~395 Pages
• 20 Chapters
• $9.99 http://amzn.to/1a55L89
Slide Deck & Source Code
• Slide Deck – slidesha.re/15YTrTT
• Source Code – http://GitHub.com/docluv
Annoying?
Web Performance Optimization
Web performance optimization, WPO, or website optimization involves
ongoing monitoring and testing of websites to achieve optimum
performance under given constraints. Usually optimization is restricted
due to lack of complete information and metrics to evaluate the
performance of a website.
http://bit.ly/SWEh6E
Matt Cutts
"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 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 is Money
• 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
WalMart
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. 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
Google’s ½ Second
Half a second delay caused a 20% drop in traffic. Half a second delay
killed user satisfaction.
The lesson, Marissa said, is that speed matters. People do not like to
wait. Do not make them.
http://bit.ly/TPPhUp
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 Are Getting Fat
http://httpArchive.org
93 Files Requests - 1.7MB
17 JavaScript Files - 276KB
5.6 CSS Files – 48KB
53 Images - 1068KB
16 Domains
46% Cacheable
Web Sites Are Getting Larger
That's Great But I Work
in the Enterprise
Performance IS Relevant
• Do you really want to waste $$$
• You want to make co-workers hate you?
• And Possibly Throw a Phone at You
• Remember the Physiological Stats?
• Slow Web Apps Have Higher Data Entry Error Rates
• Oh And You Are Going Mobile
http://bit.ly/16zFCXL
Good Code Is Cheaper
• Performance Best Practices Lead To:
• Well Structured Code
• Smaller Code
• Easier Maintenance
• Fewer Bugs
• Encourages Development Best Practices
• Encourages Discipline
OK How Do I Figure
Out How to Fix
Things?
Southwest.com
• 89 File Requests
• 5 Domains
• 2 CSS
• 8 Documents
• 39 Images
• 24 JavaScript Files
• 4 AJAX Calls
• 1MB
• 336B Request Header
• 1KB Cookie
• 2034 DOM Elements
webpagetest.org
• Online Tool
• Identifies Common Performance Issues
• Must be Public URL
http://bit.ly/1dibffr
Southwest.com
http://bit.ly/1dibffr
http://bit.ly/1dibffr
F12 To the Rescue!!
Waterfall Chart
Examine A Http Request
YSlow Rules
1. Minimize HTTP Requests
2. Use a Content Delivery Network
3. Avoid empty src or href
4. Add an Expires or a Cache-Control Header
5. Gzip Components
6. Put StyleSheets at the Top
7. Put Scripts at the Bottom
8. Avoid CSS Expressions
9. Make JavaScript and CSS External
10. Reduce DNS Lookups
11. Minify JavaScript and CSS
12. Avoid Redirects
13. Remove Duplicate Scripts
14. Configure ETags
15. Make AJAX Cacheable
16. Use GET for AJAX Requests
17. Reduce the Number of DOM Elements
18. No 404s
19. Reduce Cookie Size
20. Use Cookie-Free Domains for
Components
21. Avoid Filters
22. Do Not Scale Images in HTML
23. Make favicon.ico Small and Cacheable
http://yhoo.it/W7BFIw
1. Add A Fav Icon – Eliminate 404s
“Most of your scaling
problems wont be
glamorous“
Mike Krieger
http://bit.ly/QeKZsO
Make FavIcon Small and Cacheable
• Don’t Return 404
• YSlow Rule #18
• Make Sure Its Compatible
• PNG/ICO
• It Carries Cookie Weight
• Instagram Lesson #1
http://bit.ly/RUXEiL
2.Use a CDN
• Globally Distributes Resources Closer to Client
• Was Expensive
• Amazon CloudFront cost pennies a month
3. Far Future Expires Header
• Lets the Browser Cache Resources Locally
• Eliminates Future Http Requests
• The Fastest Http Request is the one not made
• Only Updates Resource if Changed on Server
4. Use LocalStorage For Storage &
Caching
• Allows You to Keep Data Locally in a Hash Table
• localStorage
• sessionStorage
• Approximately 5-10MB
• Replace Cookies
• Great For Caching
AJAX Prefilter
• Checks localStorage Before Making AJAX Call
• Stores Data in localStorage with Expiration Value
• Radically Reduces Http Requests
• Radically Improves Performance
5. Optimize Images
• Images are Too Large
• PNGCrush, Kraken.io
• Image Sprites
• Glyph Fonts
• Data URIs
• CSS Rules
37
• CSS Sprites
• Consider Gyph/Icon Font
• CSS Gradients, Border Radius, Shadows
• Text
• This is a 30KB Image – Possible Change to 0KB*
6. No More Cookies
• Cookies Add Weight
• Place Resources (img/css/js) on
Cookieless Domains
• CDNs Are Great For No Cookies
• Consider Local Storage Instead
SWA & Cookies
39
Impact of Cookies on Response Time
40
Is 78ms A Big Deal???
• Remember 95 Files
• 95 * 78ms = 7410ms or 7+ Seconds
• Does Cause Delay
• Parallel Downloads Help Overall Time
• Don’t Use 95 Files, Duh
41
7. Bundle & Minify CSS & JavaScript
• Eliminate Excess HTTP Requests
• Reduces Data Footprint
• This is a Release or Production Version
• Shoot for a Single JS and a Single CSS file in Production
Use A Client Build System
• Bundling & Minification is OK
• Grunt Is Very Easy & Extensive
• Validate Scripts
• Combine & Minify Scripts
• Validate CSS
• Combine & Minify CSS
• Many Other Tasks
• http://bit.ly/1kcrpuo
Using Grunt JS
• Setup Using NPM
• npm install -g grunt-cli
• Add Grunt files
• package.json
• grunt.js
Common Contrib Extensions
• Uglify
• JSHint
• Handlebars
• HTMLMIN
• Jasmine
• Qunit
• Watch
• YuiDoc
Package.json
46
{
"name": “webmovies",
"version": "0.0.4",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-nodeunit": "~0.1.2",
"grunt-contrib": "~0.6.1"
}
}
Grunt.js
8. Gzip Text Content
• Browsers Support Gzip & Deflate Algorithms
• Reduces Text Base Content Size
• Makes it Easier to Traverse Intertubes
• 14kb Critical Packet Size
• This is the Goal for Optimal Mobile Performance
Configure Gzip in IIS
Configure Gzip in Amazon S3 |
CloudFront
9. CSS @ Top – JavaScript @ Bottom
• CSS is Read & Evaluated to Build CSSOM
• Late CSS causes Browser to ‘Start All Over’
• JavaScript is a Blocking Action
• Browser Stops Everything
• Script Must Be Loaded
• Script Must Be Evaluated
• Use Async & Defer Attributes
10. External CSS & JavaScript
• Allows Resources to be Cached Independently of Markup
• Reduces Page Weight
• Reduces Chance of Duplicate Code
• Can Be Bundled & Minified
Critical Rendering Path
Bonus – Use AppCache
• <html lang="en-US" manifest="ie11WebSite.appcache">
• Stores Resources Locally in a Sandbox Cache for the Domain
• Available Offline
• Has an Event API
Bonus – Use AppCache
CACHE MANIFEST
# version 0.07
CACHE:
#images
favicon.ico
img/purple-bkg.jpg
#css
css/site.min.css
#js
js/applib.js
NETWORK:
#http://example.com/api/
#http://api.rottentomatoes.com/api/public/v1.0/
FALLBACK:
#http://content9.flixster.com/movie/*.jpg /img/offline-poster.png

Contenu connexe

Tendances

High Performance Web/Mobile Pages - Automation
High Performance Web/Mobile Pages - AutomationHigh Performance Web/Mobile Pages - Automation
High Performance Web/Mobile Pages - Automation
soheil416
 
Tim Scollick - Flex, Seo And You
Tim Scollick - Flex, Seo And YouTim Scollick - Flex, Seo And You
Tim Scollick - Flex, Seo And You
Refresh Events
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
Acquia
 
Developer Tools And Page Speed
Developer  Tools And  Page  SpeedDeveloper  Tools And  Page  Speed
Developer Tools And Page Speed
Lina Shamiah
 

Tendances (20)

Developing and deploying a website with html5
Developing and deploying a website with html5Developing and deploying a website with html5
Developing and deploying a website with html5
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer
 
High Performance Web/Mobile Pages - Automation
High Performance Web/Mobile Pages - AutomationHigh Performance Web/Mobile Pages - Automation
High Performance Web/Mobile Pages - Automation
 
Tim Scollick - Flex, Seo And You
Tim Scollick - Flex, Seo And YouTim Scollick - Flex, Seo And You
Tim Scollick - Flex, Seo And You
 
Mobile web performance dwx13
Mobile web performance dwx13Mobile web performance dwx13
Mobile web performance dwx13
 
Page Experience Update SMX 2020 (Aleks Shklyar)
Page Experience Update SMX 2020 (Aleks Shklyar)Page Experience Update SMX 2020 (Aleks Shklyar)
Page Experience Update SMX 2020 (Aleks Shklyar)
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
My Website Is Old Enough To Vote - Kris Howard
My Website Is Old Enough To Vote - Kris HowardMy Website Is Old Enough To Vote - Kris Howard
My Website Is Old Enough To Vote - Kris Howard
 
Ajax
AjaxAjax
Ajax
 
improving the performance of Rails web Applications
improving the performance of Rails web Applicationsimproving the performance of Rails web Applications
improving the performance of Rails web Applications
 
Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015Speeding up your WordPress Site - WordCamp Toronto 2015
Speeding up your WordPress Site - WordCamp Toronto 2015
 
SEO Tune Up: Technical and Performance
SEO Tune Up: Technical and PerformanceSEO Tune Up: Technical and Performance
SEO Tune Up: Technical and Performance
 
Time is the enemy
Time is the enemyTime is the enemy
Time is the enemy
 
Web performance: beyond load testing
Web performance: beyond load testingWeb performance: beyond load testing
Web performance: beyond load testing
 
Developer Tools And Page Speed
Developer  Tools And  Page  SpeedDeveloper  Tools And  Page  Speed
Developer Tools And Page Speed
 
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
My Website is Old Enough to Vote - My Website Can Vote - Building Sites That ...
 
2010 11 pubcon_hendison_wordpress
2010 11 pubcon_hendison_wordpress2010 11 pubcon_hendison_wordpress
2010 11 pubcon_hendison_wordpress
 
Web Application Development Fundamentals
Web Application Development FundamentalsWeb Application Development Fundamentals
Web Application Development Fundamentals
 
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: Modernising Your Domino and XPages Applications
 

En vedette

Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
Chau Thanh
 
Architecture of a Modern Web App
Architecture of a Modern Web AppArchitecture of a Modern Web App
Architecture of a Modern Web App
scothis
 

En vedette (11)

Scaling your website
Scaling your websiteScaling your website
Scaling your website
 
A301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoringA301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoring
 
Gear6 and Scaling Website Performance: Caching Session and Profile Data with...
Gear6 and Scaling Website Performance:  Caching Session and Profile Data with...Gear6 and Scaling Website Performance:  Caching Session and Profile Data with...
Gear6 and Scaling Website Performance: Caching Session and Profile Data with...
 
Best Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesBest Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web Sites
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
 
Deep Dive: Scaling Up to Your First 10 Million Users
Deep Dive: Scaling Up to Your First 10 Million UsersDeep Dive: Scaling Up to Your First 10 Million Users
Deep Dive: Scaling Up to Your First 10 Million Users
 
IoC and Mapper in C#
IoC and Mapper in C#IoC and Mapper in C#
IoC and Mapper in C#
 
Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web apps
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications
 
Architecture of a Modern Web App
Architecture of a Modern Web AppArchitecture of a Modern Web App
Architecture of a Modern Web App
 
10 Best Practices of a Best Company to Work For
10 Best Practices of a Best Company to Work For10 Best Practices of a Best Company to Work For
10 Best Practices of a Best Company to Work For
 

Similaire à 10 Things You Can Do to Speed Up Your Web App Today

Website Performance
Website PerformanceWebsite Performance
Website Performance
Hugo Fonseca
 

Similaire à 10 Things You Can Do to Speed Up Your Web App Today (20)

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 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applications
 
Why your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix itWhy your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix it
 
Why your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix itWhy your slow loading website is costing you sales and how to fix it
Why your slow loading website is costing you sales and how to fix it
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
A Day Building Fast, Responsive, Extensible Single Page Applications
A Day Building Fast, Responsive, Extensible Single Page ApplicationsA Day Building Fast, Responsive, Extensible Single Page Applications
A Day Building Fast, Responsive, Extensible Single Page Applications
 
WordPress Theme Performance - WP Vienna meetup 8.6.2016
WordPress Theme Performance - WP Vienna meetup 8.6.2016WordPress Theme Performance - WP Vienna meetup 8.6.2016
WordPress Theme Performance - WP Vienna meetup 8.6.2016
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
 
Page Performance
Page PerformancePage Performance
Page Performance
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark Tomlinson
 
Web Performance First Aid
Web Performance First AidWeb Performance First Aid
Web Performance First Aid
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
 
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Life in the Fast Lane: Speed, Usability & Search Engine Optimization
Life in the Fast Lane: Speed, Usability & Search Engine OptimizationLife in the Fast Lane: Speed, Usability & Search Engine Optimization
Life in the Fast Lane: Speed, Usability & Search Engine Optimization
 
Making the web faster
Making the web fasterMaking the web faster
Making the web faster
 
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
WebHosting Performance / WordPress  - Pubcon Vegas - HendisonWebHosting Performance / WordPress  - Pubcon Vegas - Hendison
WebHosting Performance / WordPress - Pubcon Vegas - Hendison
 

Plus de Chris Love

Plus de Chris Love (20)

Quick Fetch API Introduction
Quick Fetch API IntroductionQuick Fetch API Introduction
Quick Fetch API Introduction
 
Introduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsIntroduction to Progressive Web Applications
Introduction to Progressive Web Applications
 
Introduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsIntroduction to Progressive Web Applications
Introduction to Progressive Web Applications
 
Lazy load Website Assets
Lazy load Website AssetsLazy load Website Assets
Lazy load Website Assets
 
Progressive Web Apps for Education
Progressive Web Apps for EducationProgressive Web Apps for Education
Progressive Web Apps for Education
 
The server is dead going serverless to create a highly scalable application y...
The server is dead going serverless to create a highly scalable application y...The server is dead going serverless to create a highly scalable application y...
The server is dead going serverless to create a highly scalable application y...
 
Real World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingReal World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker Caching
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
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
 
Develop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will loveDevelop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will love
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Advanced front end debugging with ms edge and ms tools
Advanced front end debugging with ms edge and ms toolsAdvanced front end debugging with ms edge and ms tools
Advanced front end debugging with ms edge and ms tools
 
Html5 Fit: Get Rid of Love Handles
Html5 Fit:  Get Rid of Love HandlesHtml5 Fit:  Get Rid of Love Handles
Html5 Fit: Get Rid of Love Handles
 
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
Using Responsive Web Design To Make Your Web Work Everywhere - UpdatedUsing Responsive Web Design To Make Your Web Work Everywhere - Updated
Using Responsive Web Design To Make Your Web Work Everywhere - Updated
 
Implementing a Responsive Image Strategy
Implementing a Responsive Image StrategyImplementing a Responsive Image Strategy
Implementing a Responsive Image Strategy
 
Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work EverywhereUsing Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere
 
An Introduction to Microsoft Edge
An Introduction to Microsoft EdgeAn Introduction to Microsoft Edge
An Introduction to Microsoft Edge
 
There Is No Mobile: An Introduction To Responsive Web Design
There Is No Mobile: An Introduction To Responsive Web DesignThere Is No Mobile: An Introduction To Responsive Web Design
There Is No Mobile: An Introduction To Responsive Web Design
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
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...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

10 Things You Can Do to Speed Up Your Web App Today

  • 1. 10 Things You Can Do Today To Speed Up Your Web Application Chris Love @ChrisLove Love2Dev.com
  • 2. Who Am I • ASP.NET MVP • ASP Insider • Internet Explorer User Agent • Author • Speaker • Tweaker, Lover of Web, JavaScript, CSS & HTML5 • @ChrisLove • Love2Dev.com
  • 3. High Performance Single Page Web Applications • Responsive Design • Touch • Mobile First • SPA • Extensible, Scalable Architecture • Web Build and Workflow • Goes Really Fast! • ~395 Pages • 20 Chapters • $9.99 http://amzn.to/1a55L89
  • 4. Slide Deck & Source Code • Slide Deck – slidesha.re/15YTrTT • Source Code – http://GitHub.com/docluv
  • 5.
  • 7. Web Performance Optimization Web performance optimization, WPO, or website optimization involves ongoing monitoring and testing of websites to achieve optimum performance under given constraints. Usually optimization is restricted due to lack of complete information and metrics to evaluate the performance of a website. http://bit.ly/SWEh6E
  • 8. Matt Cutts "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 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
  • 9. Time is Money • 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
  • 10. WalMart 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. 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
  • 11. Google’s ½ Second Half a second delay caused a 20% drop in traffic. Half a second delay killed user satisfaction. The lesson, Marissa said, is that speed matters. People do not like to wait. Do not make them. http://bit.ly/TPPhUp
  • 12. 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
  • 13. Web Sites Are Getting Fat http://httpArchive.org 93 Files Requests - 1.7MB 17 JavaScript Files - 276KB 5.6 CSS Files – 48KB 53 Images - 1068KB 16 Domains 46% Cacheable
  • 14. Web Sites Are Getting Larger
  • 15.
  • 16. That's Great But I Work in the Enterprise
  • 17. Performance IS Relevant • Do you really want to waste $$$ • You want to make co-workers hate you? • And Possibly Throw a Phone at You • Remember the Physiological Stats? • Slow Web Apps Have Higher Data Entry Error Rates • Oh And You Are Going Mobile
  • 19. Good Code Is Cheaper • Performance Best Practices Lead To: • Well Structured Code • Smaller Code • Easier Maintenance • Fewer Bugs • Encourages Development Best Practices • Encourages Discipline
  • 20. OK How Do I Figure Out How to Fix Things?
  • 21.
  • 22. Southwest.com • 89 File Requests • 5 Domains • 2 CSS • 8 Documents • 39 Images • 24 JavaScript Files • 4 AJAX Calls • 1MB • 336B Request Header • 1KB Cookie • 2034 DOM Elements
  • 23. webpagetest.org • Online Tool • Identifies Common Performance Issues • Must be Public URL http://bit.ly/1dibffr
  • 26. F12 To the Rescue!!
  • 28. Examine A Http Request
  • 29. YSlow Rules 1. Minimize HTTP Requests 2. Use a Content Delivery Network 3. Avoid empty src or href 4. Add an Expires or a Cache-Control Header 5. Gzip Components 6. Put StyleSheets at the Top 7. Put Scripts at the Bottom 8. Avoid CSS Expressions 9. Make JavaScript and CSS External 10. Reduce DNS Lookups 11. Minify JavaScript and CSS 12. Avoid Redirects 13. Remove Duplicate Scripts 14. Configure ETags 15. Make AJAX Cacheable 16. Use GET for AJAX Requests 17. Reduce the Number of DOM Elements 18. No 404s 19. Reduce Cookie Size 20. Use Cookie-Free Domains for Components 21. Avoid Filters 22. Do Not Scale Images in HTML 23. Make favicon.ico Small and Cacheable http://yhoo.it/W7BFIw
  • 30. 1. Add A Fav Icon – Eliminate 404s “Most of your scaling problems wont be glamorous“ Mike Krieger http://bit.ly/QeKZsO
  • 31. Make FavIcon Small and Cacheable • Don’t Return 404 • YSlow Rule #18 • Make Sure Its Compatible • PNG/ICO • It Carries Cookie Weight • Instagram Lesson #1 http://bit.ly/RUXEiL
  • 32. 2.Use a CDN • Globally Distributes Resources Closer to Client • Was Expensive • Amazon CloudFront cost pennies a month
  • 33. 3. Far Future Expires Header • Lets the Browser Cache Resources Locally • Eliminates Future Http Requests • The Fastest Http Request is the one not made • Only Updates Resource if Changed on Server
  • 34. 4. Use LocalStorage For Storage & Caching • Allows You to Keep Data Locally in a Hash Table • localStorage • sessionStorage • Approximately 5-10MB • Replace Cookies • Great For Caching
  • 35. AJAX Prefilter • Checks localStorage Before Making AJAX Call • Stores Data in localStorage with Expiration Value • Radically Reduces Http Requests • Radically Improves Performance
  • 36. 5. Optimize Images • Images are Too Large • PNGCrush, Kraken.io • Image Sprites • Glyph Fonts • Data URIs • CSS Rules
  • 37. 37 • CSS Sprites • Consider Gyph/Icon Font • CSS Gradients, Border Radius, Shadows • Text • This is a 30KB Image – Possible Change to 0KB*
  • 38. 6. No More Cookies • Cookies Add Weight • Place Resources (img/css/js) on Cookieless Domains • CDNs Are Great For No Cookies • Consider Local Storage Instead
  • 40. Impact of Cookies on Response Time 40
  • 41. Is 78ms A Big Deal??? • Remember 95 Files • 95 * 78ms = 7410ms or 7+ Seconds • Does Cause Delay • Parallel Downloads Help Overall Time • Don’t Use 95 Files, Duh 41
  • 42. 7. Bundle & Minify CSS & JavaScript • Eliminate Excess HTTP Requests • Reduces Data Footprint • This is a Release or Production Version • Shoot for a Single JS and a Single CSS file in Production
  • 43. Use A Client Build System • Bundling & Minification is OK • Grunt Is Very Easy & Extensive • Validate Scripts • Combine & Minify Scripts • Validate CSS • Combine & Minify CSS • Many Other Tasks • http://bit.ly/1kcrpuo
  • 44. Using Grunt JS • Setup Using NPM • npm install -g grunt-cli • Add Grunt files • package.json • grunt.js
  • 45. Common Contrib Extensions • Uglify • JSHint • Handlebars • HTMLMIN • Jasmine • Qunit • Watch • YuiDoc
  • 46. Package.json 46 { "name": “webmovies", "version": "0.0.4", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-jshint": "~0.1.1", "grunt-contrib-nodeunit": "~0.1.2", "grunt-contrib": "~0.6.1" } }
  • 48. 8. Gzip Text Content • Browsers Support Gzip & Deflate Algorithms • Reduces Text Base Content Size • Makes it Easier to Traverse Intertubes • 14kb Critical Packet Size • This is the Goal for Optimal Mobile Performance
  • 50. Configure Gzip in Amazon S3 | CloudFront
  • 51. 9. CSS @ Top – JavaScript @ Bottom • CSS is Read & Evaluated to Build CSSOM • Late CSS causes Browser to ‘Start All Over’ • JavaScript is a Blocking Action • Browser Stops Everything • Script Must Be Loaded • Script Must Be Evaluated • Use Async & Defer Attributes
  • 52. 10. External CSS & JavaScript • Allows Resources to be Cached Independently of Markup • Reduces Page Weight • Reduces Chance of Duplicate Code • Can Be Bundled & Minified
  • 54. Bonus – Use AppCache • <html lang="en-US" manifest="ie11WebSite.appcache"> • Stores Resources Locally in a Sandbox Cache for the Domain • Available Offline • Has an Event API
  • 55. Bonus – Use AppCache CACHE MANIFEST # version 0.07 CACHE: #images favicon.ico img/purple-bkg.jpg #css css/site.min.css #js js/applib.js NETWORK: #http://example.com/api/ #http://api.rottentomatoes.com/api/public/v1.0/ FALLBACK: #http://content9.flixster.com/movie/*.jpg /img/offline-poster.png

Notes de l'éditeur

  1. Update these #s before the presentation as they are always updating
  2. Update chart from latest httpArchive stats
  3. Going to use it for examination purposes since they do a lot of bad things, its an enterprise and it’s a public facing site.
  4. Update these #s prior to presentation, define a real world baseline example