SlideShare a Scribd company logo
ben@cornershopcreative.com
front-end
performance
optimization
#WCDAYTON
SPEED MATTERS
SEO - UX - Sales - Mobile
OUR ENEMIES
Payload size

Bloated DOM & CSS

HTTP connections
JavaScript blocking
DNS lookups
NOT COVERED
Apache/mySQL config
!
Using a CDN
!
Choosing a good host
REDUCE PAYLOAD
a.k.a. front-end performance 101
REDUCE ASSET SIZES
Minify your JS and CSS (and HTML)
Load properly-sized images
Use right image filetypes 

(gif/jpg/png/svg)
DEFER ASSET LOADING
“lazy load” images when they 

appear in browser window
Use async/defer <script> attributes
!
Also, load pre-cached stuff!
<script defer async src="script.js"></script>
TRICKING
WP_ENQUEUE_SCRIPT
function	
  add_async(	
  $url	
  )	
  {	
  
	
  	
  if	
  (strpos($url,	
  '#async')===false)	
  
	
  	
  	
  	
  return	
  $url;	
  
	
  	
  else	
  if	
  (is_admin())	
  
	
  	
  	
  	
  return	
  str_replace('#async',	
  '',	
  $url);	
  
	
  	
  else	
  
	
  	
  	
  	
  return	
  str_replace('#async',	
  '',	
  $url)."'	
  async";	
  	
  
}	
  
add_filter('clean_url',	
  'add_async',	
  11,	
  1);
wp_enqueue_script('demo',	
  '/js/myscript.js#async'	
  );
USING GOOGLE’S
JQUERY
wp_deregister_script('jquery');	
  
wp_register_script(	
  
	
  	
  'jquery',	
  	
  
	
  	
  'http://ajax.googleapis.com/ajax/libs/jquery/
1.11.0/jquery.min.js',	
  
	
  	
  array(),	
  
	
  	
  '1.11.0'	
  
);	
  
BLOATED DOM & CSS
make it clean before you make it mini
MORE ELEMENTS = SLOWER
<body class="page">	
<div id="wrapper">	
<div id="page">	
<div id="main">	
<div class="main-side">	
<aside id="sidebar">	
...	
</aside>	
</div>	
</div>	
</div>	
</div>	
</body>
You can do a count with:
!
$(‘*’).length;
!
or
!
document.
getElementsByTagName(‘*”).
length
SIMPLE SELECTORS
html body div#main article#post-22 p a.inline {

property: value;

}
.inline {

property: value;

}
VS.
ul li {} is slower than ul > li {} which is slower than .ul-li {}
HTTP CONNECTIONS
your biggest obstacles to fast loads
HTTP CONNECTIONS
Each asset (script, image, css file,
font, etc) is retrieved via an HTTP
connection.
Each connection takes a moment
to start due to overhead.
HTTP HEADERS
REDUCING
CONNECTIONS
Combine CSS Files
Combine JS Files
Use CSS Sprites
Avoid images in favor of CSS
Don’t load stuff you don’t need*
COMBINING CSS FILES
Use a tool like SASS that combines
them for you
Only write a single style.css
Use a plugin (e.g. W3 Total Cache) to
combine (& compress!) them for you.
COMBINING JS FILES
Use a plugin (e.g. W3 Total Cache)
to combine+compress

them for you.
Manually put all your jQuery 

plugins into a single file.
COMBINING JS FILES
WordPress is especially prone to
loading lots of JS files
It’s worth the effort to mitigate
against this. Seriously.
CSS SPRITES
Put all your images into a single 

file, and use CSS to position the
background properly.
CSS SPRITE EXAMPLE
.sprite-ben {
height: 117px;
width: 91px;
background-image: url('img/sprite.png');
background-position: 0 -525px;
background-repeat: no-repeat;
}
overall sprite.png file
measures 304 x 910
but my headshot is a small part
DON’T USE IMAGES
CSS3 provides alternatives:
Gradients
Rounded Corners
Text and box shadows
Rotation
JAVASCRIPT BLOCKING
And sequential loading general
SEQUENTIAL VS. PARALLEL
Browsers can load some
assets in parallel, such as
CSS files, images, and
fonts. This is good.
But some assets —JS files
— are loaded in sequence
and block others.
CSS AND SCRIPTS
JS should be at bottom of page.
CSS should go at the top of your
page and be loaded via
<link> not @import
IN WORDPRESS
wp_enqueue_script( 	
$handle,	
$src,	
$deps,	
$ver,	
$in_footer 	
);
Set to TRUE
DNS LOOKUPS
hidden time thieves
DNS LOOKUPS
Every domain mentioned 

on your page needs to be
resolved to an IP (20-120 ms)
!
But too few domains 

is bad too.
TOOLS
FOR MORE
Google “Steve Souder”
https://developers.google.com/speed/docs/best-
practices/rules_intro
!
http://developer.yahoo.com/yslow/
!
https://developers.google.com/speed/
pagespeed/
CONNECT
Ben Byrne
ben@cornershopcreative.com
facebook.com/drywall
Twitter: @drywall

More Related Content

What's hot

How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! Site
Daniel Kanchev
 

What's hot (20)

Web performance
Web performanceWeb performance
Web performance
 
WordPress & Backbone.js
WordPress & Backbone.jsWordPress & Backbone.js
WordPress & Backbone.js
 
Os mobile
Os mobileOs mobile
Os mobile
 
Client responsive design
Client   responsive designClient   responsive design
Client responsive design
 
Hello, Canvas.
Hello, Canvas.Hello, Canvas.
Hello, Canvas.
 
Hidden Secrets For A Hack-Proof Joomla! Site
Hidden Secrets For A Hack-Proof Joomla! SiteHidden Secrets For A Hack-Proof Joomla! Site
Hidden Secrets For A Hack-Proof Joomla! Site
 
You know what iMEAN? Using MEAN stack for application dev on Informix
You know what iMEAN? Using MEAN stack for application dev on InformixYou know what iMEAN? Using MEAN stack for application dev on Informix
You know what iMEAN? Using MEAN stack for application dev on Informix
 
Os mobile
Os mobileOs mobile
Os mobile
 
jQuery - Web Engineering
jQuery - Web Engineering jQuery - Web Engineering
jQuery - Web Engineering
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
 
Introduction to mean stack
Introduction to mean stackIntroduction to mean stack
Introduction to mean stack
 
Mean PPT
Mean PPTMean PPT
Mean PPT
 
Wordpress as a Backend
Wordpress as a BackendWordpress as a Backend
Wordpress as a Backend
 
How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014
 
Html5 & less css
Html5 & less cssHtml5 & less css
Html5 & less css
 
How to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! SiteHow to Speed Up Your Joomla! Site
How to Speed Up Your Joomla! Site
 
Going Node.js at Netflix
Going Node.js at NetflixGoing Node.js at Netflix
Going Node.js at Netflix
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UX
 
Responsive WordPress workflow
Responsive WordPress workflowResponsive WordPress workflow
Responsive WordPress workflow
 
How to Speed Up Your Joomla Website
How to Speed Up Your Joomla WebsiteHow to Speed Up Your Joomla Website
How to Speed Up Your Joomla Website
 

Viewers also liked

Front end optimization
Front end optimizationFront end optimization
Front end optimization
Abhishek Anand
 
Automated cell counters
Automated  cell countersAutomated  cell counters
Automated cell counters
Richa Sharma
 

Viewers also liked (10)

Front end optimization
Front end optimizationFront end optimization
Front end optimization
 
WordPress Front End Optimizations
WordPress Front End OptimizationsWordPress Front End Optimizations
WordPress Front End Optimizations
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
 
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...
Cloud Connect Santa Clara 2013: Web Acceleration and Front-End Optimization (...
 
Front-End Optimization (FEO)
Front-End Optimization (FEO)Front-End Optimization (FEO)
Front-End Optimization (FEO)
 
Marrying CDNs with Front-End Optimization
Marrying CDNs with Front-End Optimization Marrying CDNs with Front-End Optimization
Marrying CDNs with Front-End Optimization
 
Heavy Web Optimization: Frontend
Heavy Web Optimization: FrontendHeavy Web Optimization: Frontend
Heavy Web Optimization: Frontend
 
Online shopping report-6 month project
Online shopping report-6 month projectOnline shopping report-6 month project
Online shopping report-6 month project
 
Automated cell counters
Automated  cell countersAutomated  cell counters
Automated cell counters
 
Image processing ppt
Image processing pptImage processing ppt
Image processing ppt
 

Similar to Front-End Performance Optimization in WordPress

Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and Scalability
Ashok Modi
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
Zohar Arad
 

Similar to Front-End Performance Optimization in WordPress (20)

10 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 201210 Tips to make your Website lightning-fast - SMX Stockholm 2012
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
 
RESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side ComponentsRESS – Responsive Webdesign and Server Side Components
RESS – Responsive Webdesign and Server Side Components
 
The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013The Need for Speed - SMX Sydney 2013
The Need for Speed - SMX Sydney 2013
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance
 
Using Tailwind Background Image Add Beautiful Images Easily.pdf
Using Tailwind Background Image Add Beautiful Images Easily.pdfUsing Tailwind Background Image Add Beautiful Images Easily.pdf
Using Tailwind Background Image Add Beautiful Images Easily.pdf
 
Squishy pixels
Squishy pixelsSquishy pixels
Squishy pixels
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
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
 
Adaptive theming using compass susy grid
Adaptive theming using compass susy gridAdaptive theming using compass susy grid
Adaptive theming using compass susy grid
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and Scalability
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
 
Liking performance
Liking performanceLiking performance
Liking performance
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
Hardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationHardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ation
 
Web performance essentials - Goodies
Web performance essentials - GoodiesWeb performance essentials - Goodies
Web performance essentials - Goodies
 

More from drywallbmb

More from drywallbmb (9)

Accessibility: Beginning the Journey
Accessibility: Beginning the JourneyAccessibility: Beginning the Journey
Accessibility: Beginning the Journey
 
Do more, faster, by extending WP-CLI
Do more, faster, by extending WP-CLIDo more, faster, by extending WP-CLI
Do more, faster, by extending WP-CLI
 
Accessibility: Beginning the Journey
Accessibility: Beginning the JourneyAccessibility: Beginning the Journey
Accessibility: Beginning the Journey
 
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLIAccelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
 
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLIAccelerating Custom Development with Dynamic Scaffolding and WP-CLI
Accelerating Custom Development with Dynamic Scaffolding and WP-CLI
 
Making Multisite Work for You
Making Multisite Work for YouMaking Multisite Work for You
Making Multisite Work for You
 
Finding your way with Sass+Compass
Finding your way with Sass+CompassFinding your way with Sass+Compass
Finding your way with Sass+Compass
 
10 Cool Things You Can Do with Widgets
10 Cool Things You Can Do with Widgets10 Cool Things You Can Do with Widgets
10 Cool Things You Can Do with Widgets
 
The Difference Between Print and Web Design
The Difference Between Print and Web DesignThe Difference Between Print and Web Design
The Difference Between Print and Web Design
 

Recently uploaded

Recently uploaded (20)

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 

Front-End Performance Optimization in WordPress