SlideShare une entreprise Scribd logo
1  sur  34
BEING A TWEAKER - MODERN WEB
PERFORMANCE TECHNIQUES

Chris Love
Tellago Inc.
http://ProfessionalASPNET.com
http://Twitter.com/ChrisLove
Diamond Sponsor
       CTREC Hilton
http://www.ctrechilton.com/
TELLAGO
REFERENCES
Essential Knowledge for
Front-End Engineers

Steve Souders
http://www.stevesouders.com/

http://amzn.to/gwf9pG
http://amzn.to/gudayQ

http://developer.yahoo.com/performa
nce/rules.html
SPEED KILLS
 Customers/Users Are Impatient
 Speed SEO Factor

 Amazon: 1 Click Purchase



   Case Study Wal-Mart
SPEED KILLS




http://bit.ly/xfvPMC
SPEED KILLS




http://bit.ly/xfvPMC
SPEED KILLS
 For every 1 second of improvement they
  experienced up to a 2% increase in
  conversions
 For every 100 ms of improvement, they grew
  incremental revenue by up to 1%
 SEO benefits for entry pages and reduce
  bounces
TOOLS
   IE – F12
     Networking

     Profiling

   FireFox
     FireBug     – Yslow Plugin
   WebKit
     Developer     Tools Ctrl + Shift + I
MAKE FEWER REQUESTS
•   Each Request Adds More Overhead
•   Avoid Slicing Images that are not Reused
•   Image Maps
•   CSS Sprites
•   Inline Images
•   Combine Scripts and CSS
BUNDLING & MINIFICATION
 Reduces Requests
 Reduces Size


 JSMin http://bit.ly/tzBeo
 YUI Compressor http://yhoo.it/AWec
 Google Closure Compiler http://bit.ly/aNwjz
 AJAXMin http://bit.ly/cCCKEI
 Cassette http://bit.ly/zsGm8X
BUNDLING & MINIFICATION
 ASP.NET 4.0 Includes New Tool
 Gu’s Blog Post http://bit.ly/su4zHd



 JS & CSS
 Granular Control

 Custom Rules

 Demo http://bit.ly/q5sFNK
COMPRESS
•   Reduces Content being sent over the wire
•   Gzip, Deflate
•   Increases Processer Demand on both ends
•   IIS 6 and IIS 7
•   http://technet2.microsoft.com/windowsserver2008/en/library/
    60f3fa55-f005-496e-9d2f-cc4fc2732fce1033.mspx?mfr=true
•   Blowry
•   Various ISAPI Filters
IMAGE SPRITES
 Add Multiple Images
  together
 Great for Icons

 Use CSS positioning to set
  background-image
IMAGE SPRITES
div {
        background:url(icon-sprites.png);
        margin:3px;
   }

  .sprite1
  {
      width:24px;
      height:26px;
      background-position: 0px 0px;
  }
DATA URIS
 Base64 Encode Data
 Eliminates Requests

 Do Not Use for LARGE Images



<img src="data:image/png;base64, {mystery
meat} " alt="Texas Rangers">
SINGLE PAGE APPS
 Can Reduce Requests
 Snappy Page & Content Transitions

 Be Cautious of Browser Memory Pressures
DEFERRED CONTENT
 Load Content in the background
 Predictive Loading

 Use the IMG load event to load next image
USE CDN
   Common Scripts & Resources
   Reduces Requests (sort of)
   Typically Not Compressed (but that’s OK)
USE CDN
<script
src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.
min.js"></script>
<script> window.jQuery || document.write("<script
src='@Url.Content("~/js/libs/jquery-
1.7.1.min.js")'>x3C/script>")</script>
<script
src="//ajax.aspnetcdn.com/ajax/jquery.templates/beta1/
jquery.tmpl.min.js"></script>
<script>window.jQuery.fn.tmpl ||
document.write("<script
src='@Url.Content("~/js/libs/jquery.tmpl.min.js")'>x3C/s
cript>")</script>
STYLES @ TOP
 Browser   needs Styles to Render
  Markup
 Avoid Inline Styles
SCRIPTS @ BOTTOM
 SCRIPT tag is a blocking Tag
 Scripts Must Be Evaluated before proceding

 Allows markup to be rendered 1st (perceived
  perf)
 Exception - modernizr
STORAGE
 LocalStorage
 IndexDB

 WebSQL (deprecated)



   IndexDB & WebSQL have better perf and
    reliability
JQUERY PERFORMANCE
 Always Use Latest Version
 Use CDNs (Google, Microsoft)
USE FOR NOT $.EACH
var array = new Array ();
for (var i=0; i<10000; i++) {
           array[i] = 0;
}
console.time('native');
var l = array.length;
for (var i=0;i<l; i++) {
           array[i] = i;
}
console.timeEnd('native');
console.time('jquery');
$.each (array, function (i) {
           array[i] = i;
});
console.timeEnd('jquery');
USE FOR NOT $.EACH
USE IDS NOT CLASSES
console.time('class');
var list = $('#list');
var items = '<ul>';
for (i=0; i<1000; i++) {
                  items += '<li class="item' + i + '">item</li>';
}
items += '</ul>';
list.html (items);
for (i=0; i<1000; i++) {
                  var s = $('.item' + i);
}
console.timeEnd('class');
console.time('id');
var list = $('#list');
var items = '<ul>';
for (i=0; i<1000; i++) {
                  items += '<li id="item' + i + '">item</li>';
}
items += '</ul>';
list.html (items);
for (i=0; i<1000; i++) {
                  var s = $('#item' + i);
}
console.timeEnd('id');
USE IDS NOT CLASSES
GIVE SELECTORS CONTEXT
$(“.class”).takeAction({x:y});

Vs

$(“.class”, “#container”).takeAction({x:y});
CACHE & CHAIN
$(“.class”).takeAction1({x:y});
$(“.class”).takeAction2({x:y});
$(“.class”).takeAction2({x:y});

Vs

$(“.class”).takeAction1({x:y}) .takeAction2({x:y})
.takeAction3({x:y});
CACHE & CHAIN
for (var i=0; i<1000; i++) {
       $('#list').append (i);
}

// much better this way
var item = $('#list');
for (var i=0; i<1000; i++) {
       item.append (i);
}
AVOID DOM MANIPULATION
var list = '';
for (var i=0; i<1000; i++) {
      list += '<li>'+i+'</li>';
}
('#list').html (list);
JOIN NOT CONCAT
var array = [];
for (var i=0; i<=10000; i++) {
      array[i] = '<li>'+i+'</li>';
}
$('#list').html (array.join (''));
RETURN FALSE
$('#item').click (function () {
// stuff here
      return false;
});

Contenu connexe

Tendances

Embracing Capybara
Embracing CapybaraEmbracing Capybara
Embracing CapybaraTim Moore
 
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoYou're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoChris Scott
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiPraveen Puglia
 
How did i steal your database
How did i steal your databaseHow did i steal your database
How did i steal your databaseMostafa Siraj
 
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series Amazon Web Services Korea
 
Automating Windows Azure
Automating Windows AzureAutomating Windows Azure
Automating Windows AzureIdo Flatow
 
You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaChris Scott
 
Aztex indian's greatest hit's.http
Aztex indian's greatest hit's.httpAztex indian's greatest hit's.http
Aztex indian's greatest hit's.httpmuradwysingermc23
 
Imager at Yokohama.pm June, 2008
Imager at Yokohama.pm June, 2008Imager at Yokohama.pm June, 2008
Imager at Yokohama.pm June, 2008Yoshiki Kurihara
 
Andy Bosch - JavaServer Faces in the cloud
Andy Bosch -  JavaServer Faces in the cloudAndy Bosch -  JavaServer Faces in the cloud
Andy Bosch - JavaServer Faces in the cloudAndy Bosch
 
Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014Brad Williams
 
AtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlassian
 
Angular Tutorial Freshers and Experienced
Angular Tutorial Freshers and ExperiencedAngular Tutorial Freshers and Experienced
Angular Tutorial Freshers and Experiencedrajkamaltibacademy
 
Measuring Image Performance
Measuring Image PerformanceMeasuring Image Performance
Measuring Image PerformanceCloudinary
 

Tendances (20)

Webdriver
WebdriverWebdriver
Webdriver
 
Api
ApiApi
Api
 
Embracing Capybara
Embracing CapybaraEmbracing Capybara
Embracing Capybara
 
F2E's Creeds
F2E's CreedsF2E's Creeds
F2E's Creeds
 
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoYou're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp Orlando
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
A re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbaiA re introduction to webpack - reactfoo - mumbai
A re introduction to webpack - reactfoo - mumbai
 
How did i steal your database
How did i steal your databaseHow did i steal your database
How did i steal your database
 
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
 
Epic South Disasters
Epic South DisastersEpic South Disasters
Epic South Disasters
 
Automating Windows Azure
Automating Windows AzureAutomating Windows Azure
Automating Windows Azure
 
You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp Atlanta
 
WebVR, an offspring of two worlds
WebVR, an offspring of two worldsWebVR, an offspring of two worlds
WebVR, an offspring of two worlds
 
Aztex indian's greatest hit's.http
Aztex indian's greatest hit's.httpAztex indian's greatest hit's.http
Aztex indian's greatest hit's.http
 
Imager at Yokohama.pm June, 2008
Imager at Yokohama.pm June, 2008Imager at Yokohama.pm June, 2008
Imager at Yokohama.pm June, 2008
 
Andy Bosch - JavaServer Faces in the cloud
Andy Bosch -  JavaServer Faces in the cloudAndy Bosch -  JavaServer Faces in the cloud
Andy Bosch - JavaServer Faces in the cloud
 
Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014Writing Secure WordPress Code WordCamp NYC 2014
Writing Secure WordPress Code WordCamp NYC 2014
 
AtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using now
 
Angular Tutorial Freshers and Experienced
Angular Tutorial Freshers and ExperiencedAngular Tutorial Freshers and Experienced
Angular Tutorial Freshers and Experienced
 
Measuring Image Performance
Measuring Image PerformanceMeasuring Image Performance
Measuring Image Performance
 

En vedette

Wedding Invitation Ann & Sam
Wedding Invitation Ann & SamWedding Invitation Ann & Sam
Wedding Invitation Ann & SamAyai
 
Responsive web design
Responsive web designResponsive web design
Responsive web designChris Love
 
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 toolsChris Love
 
Bring Your Textbook to Life! Ideas & Resources
Bring Your Textbook to Life! Ideas & ResourcesBring Your Textbook to Life! Ideas & Resources
Bring Your Textbook to Life! Ideas & ResourcesShelly Sanchez Terrell
 
Connecting to Digital Natives
Connecting to Digital NativesConnecting to Digital Natives
Connecting to Digital NativesMatthew Guevara
 
Are Traditional Teaching Methods Right for Today's Students
Are Traditional Teaching Methods Right for Today's StudentsAre Traditional Teaching Methods Right for Today's Students
Are Traditional Teaching Methods Right for Today's StudentsWiley
 
Connecting With the Disconnected
Connecting With the DisconnectedConnecting With the Disconnected
Connecting With the DisconnectedChris Wejr
 
Game Based Learning for Language Learners
Game Based Learning for Language LearnersGame Based Learning for Language Learners
Game Based Learning for Language LearnersShelly Sanchez Terrell
 
What's Trending in Talent and Learning for 2016?
What's Trending in Talent and Learning for 2016?What's Trending in Talent and Learning for 2016?
What's Trending in Talent and Learning for 2016?Skillsoft
 
Engaging Learners with Technology
Engaging Learners with TechnologyEngaging Learners with Technology
Engaging Learners with TechnologyDean Shareski
 
Guided Reading: Making the Most of It
Guided Reading: Making the Most of ItGuided Reading: Making the Most of It
Guided Reading: Making the Most of ItJennifer Jones
 

En vedette (11)

Wedding Invitation Ann & Sam
Wedding Invitation Ann & SamWedding Invitation Ann & Sam
Wedding Invitation Ann & Sam
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 
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
 
Bring Your Textbook to Life! Ideas & Resources
Bring Your Textbook to Life! Ideas & ResourcesBring Your Textbook to Life! Ideas & Resources
Bring Your Textbook to Life! Ideas & Resources
 
Connecting to Digital Natives
Connecting to Digital NativesConnecting to Digital Natives
Connecting to Digital Natives
 
Are Traditional Teaching Methods Right for Today's Students
Are Traditional Teaching Methods Right for Today's StudentsAre Traditional Teaching Methods Right for Today's Students
Are Traditional Teaching Methods Right for Today's Students
 
Connecting With the Disconnected
Connecting With the DisconnectedConnecting With the Disconnected
Connecting With the Disconnected
 
Game Based Learning for Language Learners
Game Based Learning for Language LearnersGame Based Learning for Language Learners
Game Based Learning for Language Learners
 
What's Trending in Talent and Learning for 2016?
What's Trending in Talent and Learning for 2016?What's Trending in Talent and Learning for 2016?
What's Trending in Talent and Learning for 2016?
 
Engaging Learners with Technology
Engaging Learners with TechnologyEngaging Learners with Technology
Engaging Learners with Technology
 
Guided Reading: Making the Most of It
Guided Reading: Making the Most of ItGuided Reading: Making the Most of It
Guided Reading: Making the Most of It
 

Similaire à Being a tweaker modern web performance techniques

#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
AppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App PerformanceAppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App Performancerobgalvinjr
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and ImprovedTimothy Fisher
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)Igor Bronovskyy
 
Securing Java EE Web Apps
Securing Java EE Web AppsSecuring Java EE Web Apps
Securing Java EE Web AppsFrank Kim
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Doris Chen
 
The Future of CSS with Web components
The Future of CSS with Web componentsThe Future of CSS with Web components
The Future of CSS with Web componentsdevObjective
 
The Future of CSS with Web Components
The Future of CSS with Web ComponentsThe Future of CSS with Web Components
The Future of CSS with Web ComponentsColdFusionConference
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web PerformanceAdam Lu
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical WritingSarah Maddox
 
HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015Christian Heilmann
 
Date difference[1]
Date difference[1]Date difference[1]
Date difference[1]shafiullas
 
20110525[Taipei GTUG] titanium mobile簡介
20110525[Taipei GTUG] titanium mobile簡介20110525[Taipei GTUG] titanium mobile簡介
20110525[Taipei GTUG] titanium mobile簡介Justin Lee
 
The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014Christian Heilmann
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web DesignChristopher Schmitt
 
HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?Remy Sharp
 

Similaire à Being a tweaker modern web performance techniques (20)

#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
AppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App PerformanceAppForum 2014 Boost Hybrid App Performance
AppForum 2014 Boost Hybrid App Performance
 
Site optimization
Site optimizationSite optimization
Site optimization
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Securing Java EE Web Apps
Securing Java EE Web AppsSecuring Java EE Web Apps
Securing Java EE Web Apps
 
Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016Practical tipsmakemobilefaster oscon2016
Practical tipsmakemobilefaster oscon2016
 
The Future of CSS with Web components
The Future of CSS with Web componentsThe Future of CSS with Web components
The Future of CSS with Web components
 
The Future of CSS with Web Components
The Future of CSS with Web ComponentsThe Future of CSS with Web Components
The Future of CSS with Web Components
 
Building Web Hack Interfaces
Building Web Hack InterfacesBuilding Web Hack Interfaces
Building Web Hack Interfaces
 
Enhance Web Performance
Enhance Web PerformanceEnhance Web Performance
Enhance Web Performance
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015
 
Date difference[1]
Date difference[1]Date difference[1]
Date difference[1]
 
Bem methodology
Bem methodologyBem methodology
Bem methodology
 
20110525[Taipei GTUG] titanium mobile簡介
20110525[Taipei GTUG] titanium mobile簡介20110525[Taipei GTUG] titanium mobile簡介
20110525[Taipei GTUG] titanium mobile簡介
 
The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014The things browsers can do! SAE Alumni Convention 2014
The things browsers can do! SAE Alumni Convention 2014
 
[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
 
HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?
 

Plus de Chris Love

Quick Fetch API Introduction
Quick Fetch API IntroductionQuick Fetch API Introduction
Quick Fetch API IntroductionChris Love
 
Introduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsIntroduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsChris Love
 
Introduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsIntroduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsChris Love
 
Lazy load Website Assets
Lazy load Website AssetsLazy load Website Assets
Lazy load Website AssetsChris Love
 
Progressive Web Apps for Education
Progressive Web Apps for EducationProgressive Web Apps for Education
Progressive Web Apps for EducationChris Love
 
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...Chris Love
 
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 ApplicationsChris Love
 
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 CachingChris Love
 
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 applicationsChris Love
 
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
 
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 loveChris Love
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
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 HandlesChris Love
 
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 - UpdatedChris Love
 
Implementing a Responsive Image Strategy
Implementing a Responsive Image StrategyImplementing a Responsive Image Strategy
Implementing a Responsive Image StrategyChris Love
 
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 EverywhereChris Love
 
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 2016Chris Love
 
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 tipsChris Love
 
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 Chris Love
 
An Introduction to Microsoft Edge
An Introduction to Microsoft EdgeAn Introduction to Microsoft Edge
An Introduction to Microsoft EdgeChris 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...
 
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
 
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
 
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
 
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
 
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
 

Dernier

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Dernier (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Being a tweaker modern web performance techniques

  • 1. BEING A TWEAKER - MODERN WEB PERFORMANCE TECHNIQUES Chris Love Tellago Inc. http://ProfessionalASPNET.com http://Twitter.com/ChrisLove
  • 2. Diamond Sponsor CTREC Hilton http://www.ctrechilton.com/
  • 4. REFERENCES Essential Knowledge for Front-End Engineers Steve Souders http://www.stevesouders.com/ http://amzn.to/gwf9pG http://amzn.to/gudayQ http://developer.yahoo.com/performa nce/rules.html
  • 5. SPEED KILLS  Customers/Users Are Impatient  Speed SEO Factor  Amazon: 1 Click Purchase  Case Study Wal-Mart
  • 8. SPEED KILLS  For every 1 second of improvement they experienced up to a 2% increase in conversions  For every 100 ms of improvement, they grew incremental revenue by up to 1%  SEO benefits for entry pages and reduce bounces
  • 9. TOOLS  IE – F12  Networking  Profiling  FireFox  FireBug – Yslow Plugin  WebKit  Developer Tools Ctrl + Shift + I
  • 10. MAKE FEWER REQUESTS • Each Request Adds More Overhead • Avoid Slicing Images that are not Reused • Image Maps • CSS Sprites • Inline Images • Combine Scripts and CSS
  • 11. BUNDLING & MINIFICATION  Reduces Requests  Reduces Size  JSMin http://bit.ly/tzBeo  YUI Compressor http://yhoo.it/AWec  Google Closure Compiler http://bit.ly/aNwjz  AJAXMin http://bit.ly/cCCKEI  Cassette http://bit.ly/zsGm8X
  • 12. BUNDLING & MINIFICATION  ASP.NET 4.0 Includes New Tool  Gu’s Blog Post http://bit.ly/su4zHd  JS & CSS  Granular Control  Custom Rules  Demo http://bit.ly/q5sFNK
  • 13. COMPRESS • Reduces Content being sent over the wire • Gzip, Deflate • Increases Processer Demand on both ends • IIS 6 and IIS 7 • http://technet2.microsoft.com/windowsserver2008/en/library/ 60f3fa55-f005-496e-9d2f-cc4fc2732fce1033.mspx?mfr=true • Blowry • Various ISAPI Filters
  • 14. IMAGE SPRITES  Add Multiple Images together  Great for Icons  Use CSS positioning to set background-image
  • 15. IMAGE SPRITES div { background:url(icon-sprites.png); margin:3px; } .sprite1 { width:24px; height:26px; background-position: 0px 0px; }
  • 16. DATA URIS  Base64 Encode Data  Eliminates Requests  Do Not Use for LARGE Images <img src="data:image/png;base64, {mystery meat} " alt="Texas Rangers">
  • 17. SINGLE PAGE APPS  Can Reduce Requests  Snappy Page & Content Transitions  Be Cautious of Browser Memory Pressures
  • 18. DEFERRED CONTENT  Load Content in the background  Predictive Loading  Use the IMG load event to load next image
  • 19. USE CDN  Common Scripts & Resources  Reduces Requests (sort of)  Typically Not Compressed (but that’s OK)
  • 20. USE CDN <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery. min.js"></script> <script> window.jQuery || document.write("<script src='@Url.Content("~/js/libs/jquery- 1.7.1.min.js")'>x3C/script>")</script> <script src="//ajax.aspnetcdn.com/ajax/jquery.templates/beta1/ jquery.tmpl.min.js"></script> <script>window.jQuery.fn.tmpl || document.write("<script src='@Url.Content("~/js/libs/jquery.tmpl.min.js")'>x3C/s cript>")</script>
  • 21. STYLES @ TOP  Browser needs Styles to Render Markup  Avoid Inline Styles
  • 22. SCRIPTS @ BOTTOM  SCRIPT tag is a blocking Tag  Scripts Must Be Evaluated before proceding  Allows markup to be rendered 1st (perceived perf)  Exception - modernizr
  • 23. STORAGE  LocalStorage  IndexDB  WebSQL (deprecated)  IndexDB & WebSQL have better perf and reliability
  • 24. JQUERY PERFORMANCE  Always Use Latest Version  Use CDNs (Google, Microsoft)
  • 25. USE FOR NOT $.EACH var array = new Array (); for (var i=0; i<10000; i++) { array[i] = 0; } console.time('native'); var l = array.length; for (var i=0;i<l; i++) { array[i] = i; } console.timeEnd('native'); console.time('jquery'); $.each (array, function (i) { array[i] = i; }); console.timeEnd('jquery');
  • 26. USE FOR NOT $.EACH
  • 27. USE IDS NOT CLASSES console.time('class'); var list = $('#list'); var items = '<ul>'; for (i=0; i<1000; i++) { items += '<li class="item' + i + '">item</li>'; } items += '</ul>'; list.html (items); for (i=0; i<1000; i++) { var s = $('.item' + i); } console.timeEnd('class'); console.time('id'); var list = $('#list'); var items = '<ul>'; for (i=0; i<1000; i++) { items += '<li id="item' + i + '">item</li>'; } items += '</ul>'; list.html (items); for (i=0; i<1000; i++) { var s = $('#item' + i); } console.timeEnd('id');
  • 28. USE IDS NOT CLASSES
  • 31. CACHE & CHAIN for (var i=0; i<1000; i++) { $('#list').append (i); } // much better this way var item = $('#list'); for (var i=0; i<1000; i++) { item.append (i); }
  • 32. AVOID DOM MANIPULATION var list = ''; for (var i=0; i<1000; i++) { list += '<li>'+i+'</li>'; } ('#list').html (list);
  • 33. JOIN NOT CONCAT var array = []; for (var i=0; i<=10000; i++) { array[i] = '<li>'+i+'</li>'; } $('#list').html (array.join (''));
  • 34. RETURN FALSE $('#item').click (function () { // stuff here return false; });