SlideShare una empresa de Scribd logo
1 de 51
John Levandowski
                          @JohnLevandowski
                   WordCamp Salt Lake City 2012 #wcslc
                        The University of Utah




@JohnLevandowski                                         1
@JohnLevandowski   2
 Introduction
      Tools
      Compression
      Browser Caching
      Image Optimization
      Let’s Get ‘r Done
      Questions
      Bonus Content




@JohnLevandowski            3
 Business Intelligence and
       Data Warehousing at the
       University of Utah
      2005 - WordPress 1.5
      Developed blog to
       deliver internal campus
       news
      Syndicated content via
       RSS to campus portal



@JohnLevandowski                   4
 WordPress 3.4.2
      Hosted by Someone
           Shared Hosting
      Do not have root access
         to server
           Concepts still apply
      Use Apache Web Server
           Concepts still apply




@JohnLevandowski                   5
 Have Fun!
      Learn at least one thing YOU CAN DO tomorrow




@JohnLevandowski                                      6
 A Fast WordPress Site is Cool
      It’s also profitable $$$
           Can save you $$$
      Google cares about page speed
           So do your customers




@JohnLevandowski                       7
 Google Page Speed (Browser Extension)
           http://developers.google.com/speed/pagespeed/
      Yahoo Yslow Plugin (Browser Extension)
           http://developer.yahoo.com/yslow/
      GTmetrix
           http://gtmetrix.com/




@JohnLevandowski                                            8
 WebPageTest
           http://www.webpagetest.org/
      Pingdom Full Page Test
           http://tools.pingdom.com/fpt/
      Zoompf
           http://zoompf.com/




@JohnLevandowski                            9
 Twenty Eleven Theme 1.4
      No WordPress plugins
      Page Speed Grade
      YSlow Grade
      Zoompf Score
      Page Size




@JohnLevandowski                 10
@JohnLevandowski   11
@JohnLevandowski   12
@JohnLevandowski   13
@JohnLevandowski   14
@JohnLevandowski   15
 DNS Lookup
      Server Connection
      Waiting
      Content Transfer




@JohnLevandowski           16
 BACKUP your site before implementing any changes




@JohnLevandowski                                          17
 “A .htaccess (hypertext access) file is a directory-level
       configuration file supported by several web servers,
       that allows for decentralized management of web
       server configuration.”
      WordPress configuration for “Pretty Permalinks”
          # BEGIN WordPress
          <IfModule mod_rewrite.c>
          RewriteEngine On
          RewriteBase /
          RewriteRule ^index.php$ - [L]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule . /index.php [L]
          </IfModule>
          # END WordPress




@JohnLevandowski                                                   18
HTTP Compression and Minification




@JohnLevandowski                            19
 “HTTP compression is a capability that can be built
       into web servers and web clients to make better use of
       available bandwidth, and provide faster transmission
       speeds between both.”
      Gzip
      style.css
           Not Compressed
              57,094 bytes
           Compressed
              11,347 bytes




@JohnLevandowski                                                20
 Add to .htaccess file:

          <IfModule mod_deflate.c>
          AddOutputFilterByType DEFLATE text/html text/css
          text/plain text/xml application/javascript application/x-
          javascript
          </IfModule>




@JohnLevandowski                                                      21
 “Minification is the
                     process of removing all
                     unnecessary characters
                     from source code, without
                     changing its functionality.”

                    YUI Compressor
                      http://refresh-sf.com/yui/




@JohnLevandowski                                    22
 style.css
           Not Minified
              57,094 bytes
           Minified
             40,494 bytes
           Minified and
             Compressed
                8,208 bytes




@JohnLevandowski               23
 WordPress theme style.css required headers
           http://codex.wordpress.org/Theme_Development
           Change link to style.css in header.php to minified
            version
           Original
                <link rel="stylesheet" type="text/css" media="all"
                   href="<?php bloginfo( 'stylesheet_url' ); ?>" />
           Minified
             <link rel="stylesheet" type="text/css" media="all"
              href="<?php echo get_stylesheet_directory_uri(); ?>/style-
              min.css" />
           There are fancier ways to do this with filters, etc.

@JohnLevandowski                                                           24
Static Content




@JohnLevandowski         25
 Last-Modified and ETag
           Weak caching headers – request to server needed
           “Have you changed from the last time”
      Expires and Cache-Control: max-age
           Strong caching headers – no request to server needed
      Cache static content
           CSS
           JavaScript
           Images




@JohnLevandowski                                                   26
 Add to .htaccess file:

          <IfModule mod_headers.c>
          Header unset ETag
          FileETag None
          </IfModule>




@JohnLevandowski                     27
 Add to .htaccess file:
       <IfModule mod_expires.c>
       ExpiresActive on
       ExpiresByType image/jpeg "access plus 6 months"
       ExpiresByType image/png "access plus 6 months"
       ExpiresByType image/gif "access plus 6 months"
       ExpiresByType image/x-icon "access plus 6 months"
       ExpiresByType text/css "access plus 6 months"
       ExpiresByType application/javascript "access plus 6 months"
       ExpiresByType application/x-javascript "access plus 6 months"
       </IfModule>


@JohnLevandowski                                                       28
 If you cache static content you should never change
         this content
           Your frequent visitors will not see the change
      If you change the content you need to change the URL
         to that content
           Images – upload new image with different file name
           CSS and JS – add version number to URLs
              http://example.com/style.css?ver=3.4.2




@JohnLevandowski                                                 29
 Original
           <link rel="stylesheet" type="text/css" media="all"
             href="<?php bloginfo( 'stylesheet_url' ); ?>" />
      Minified
           <link rel="stylesheet" type="text/css" media="all"
             href="<?php echo get_stylesheet_directory_uri();
             ?>/style-min.css" />
      Minified with Version
           <link rel="stylesheet" type="text/css" media="all"
             href="<?php echo get_stylesheet_directory_uri();
             ?>/style-min.css?ver=<?php echo filemtime(
             get_stylesheet_directory() . '/style-min.css' ); ?>" />


@JohnLevandowski                                                       30
 favicon.ico
           Have one at the root of your website
           Or inside your <head> section using a <link> tag




@JohnLevandowski                                               31
Lossless and Lossy




@JohnLevandowski             32
August 1, 2011                           August 1, 2012




     http://httparchive.org/interesting.php   http://httparchive.org/interesting.php
     ?a=All&l=Aug%201%202011                  ?a=All&l=Aug%201%202012




@JohnLevandowski                                                                       33
@JohnLevandowski   34
 300 X 224 Pixels    600 X 448 Pixels




@JohnLevandowski                               35
@JohnLevandowski   36
 300 X 224 Pixels    600 X 448 Pixels
      57,854 bytes        57,749 bytes


@JohnLevandowski                               37
 Lossless
           allows the exact original data to be reconstructed from
            the compressed data
           removing unnecessary comments, meta-data, and color
            profiles
      Lossy
           compresses data by discarding (losing) some of it
           Images (JPEG)
           Audio (MP3, AAC, Dolby Digital AC-3)
           Blu-ray (MPEG-2, H.264/MPEG-4 AVC, VC-1)



@JohnLevandowski                                                      38
 PNGOUT, AdvPNG, Pngcrush, OptiPNG, JpegOptim,
       jpegrescan, jpegtran, Gifsicle, pngquant, pngnq …
      ImageOptim for Mac
           http://imageoptim.com/
      ImageAlpha for Mac
           http://pngmini.com/
           Convert from 24-bit to 8-bit PNG
      Similar tools are available for Windows
      http://smush.it/
      http://www.jpegmini.com/


@JohnLevandowski                                           39
 Do not scale images in browser
           Resize image before uploading to intended display size
           Exceptions for HiDPI Retina displays
      <img height=“100" width=“100" alt=“Alt Text"
       src="http://example.com/wp-
       content/uploads/2012/09/image.jpg" title=“Title Text"
       class="alignnone size-full wp-image-1">
      Image returned should natively be 100 x 100 pixels




@JohnLevandowski                                                     40
 chessboard.jpg                  comment-bubble.png
           Original                     Original
              53,906 bytes                 925 bytes
           Optimized - 79% quality      Optimized
              40,150 bytes                 767 bytes




@JohnLevandowski                                             41
@JohnLevandowski   42
Original   Optimized   % of Original
                          (bytes)    (bytes)
     html page            7,551      2,342       31%
     style.css            57,094     8,208       14%
     chessboard.jpg       53,906     40,150      74%
     comment-bubble.png   925        767         83%
     search.png           441        441         100%
     TOTAL bytes          119,917    51,908      43%
     Page Speed           58         98
     YSlow                91         97
     Zoompf               61         92




@JohnLevandowski                                                 43
@JohnLevandowski   44
Time Permitting




@JohnLevandowski          45
 Default jpeg quality is 90 for resized images
      Change jpeg quality in functions.php

          /** Lower jpeg quality for media */
          add_filter( 'jpeg_quality', 'wpselect_jpeg_quality' );
          function wpselect_jpeg_quality( $quality ) {
               return (int)79;
          }


      Insert code in a plugin or theme


@JohnLevandowski                                                   46
 To reduce the number of requests the browser makes
       to the server
      Combine numerous small images
      CSS is used to select the parts of the composite image
       to display at different points in the page
      http://spriteme.org/




@JohnLevandowski                                                47
 WP Super Cache
      W3 Total Cache




@JohnLevandowski        48
 @JohnLevandowski
      http://wpselect.com/
      http://en.gravatar.com/jlevandowski


      Slides will soon be available at:
           http://wpselect.com/




@JohnLevandowski                             49
 http://wpselect.com/blog/web-page-response-time/
      http://wpselect.com/blog/optimize-wordpress-for-page-
       speed-yslow-and-zoompf/
      http://wpselect.com/blog/wordpress-performance-
       opcode-cache/
      http://wpselect.com/blog/optimize-images-for-web-jpeg/
      http://wpselect.com/blog/optimize-images-for-web-png/




@JohnLevandowski                                                50
 http://www.flickr.com/photos/vernhart/1574355646/
      http://www.flickr.com/photos/joshfassbind/4683365102/
      http://www.flickr.com/photos/mytudut/5188623575/
      http://www.flickr.com/photos/left-hand/2863299383/
      http://www.flickr.com/photos/wbob/4171615158/
      http://www.flickr.com/photos/96dpi/466946465/
      http://www.flickr.com/photos/62172402@N07/6237005541/
      http://www.flickr.com/photos/russmorris/28389687/
      http://www.flickr.com/photos/30928442@N08/3508534114/
      http://www.flickr.com/photos/infelix/1449066379/
      http://www.flickr.com/photos/tomitapio/5126337639/
      http://www.flickr.com/photos/massenpunkt/91952193/
      http://www.flickr.com/photos/dvids/4644922363/
      http://www.flickr.com/photos/crystaljingsr/3914729343/
      http://www.flickr.com/photos/wwworks/4759535950/




@JohnLevandowski                                                51

Más contenido relacionado

La actualidad más candente

Performance Of Web Applications On Client Machines
Performance Of Web Applications On Client MachinesPerformance Of Web Applications On Client Machines
Performance Of Web Applications On Client MachinesCurelet Marius
 
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]Aaron Gustafson
 
REST Introduction (PHP London)
REST Introduction (PHP London)REST Introduction (PHP London)
REST Introduction (PHP London)Paul James
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Peter Lubbers
 
Web Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsWeb Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsAndy Davies
 
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyLuciano Resende
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
 
How clean "semantic" markup can power simple Facebook Connect integrations
How clean "semantic" markup can power simple Facebook Connect integrationsHow clean "semantic" markup can power simple Facebook Connect integrations
How clean "semantic" markup can power simple Facebook Connect integrationsThe Guardian Open Platform
 
Nl when its just too slow
Nl when its just too slowNl when its just too slow
Nl when its just too slowDoug Sillars
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5Robert Nyman
 
Responsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UIResponsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UIChris Toohey
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Nicholas Zakas
 
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011Patrick Lauke
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web AppsTimothy Fisher
 
Rest full
Rest fullRest full
Rest fullgfarid
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web PerformanceEric ShangKuan
 
Profiling php applications
Profiling php applicationsProfiling php applications
Profiling php applicationsJustin Carmony
 

La actualidad más candente (20)

Performance Of Web Applications On Client Machines
Performance Of Web Applications On Client MachinesPerformance Of Web Applications On Client Machines
Performance Of Web Applications On Client Machines
 
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
HTML5: Smart Markup for Smarter Websites [Future of Web Apps, Las Vegas 2011]
 
REST Introduction (PHP London)
REST Introduction (PHP London)REST Introduction (PHP London)
REST Introduction (PHP London)
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)
 
Web Page Test - Beyond the Basics
Web Page Test - Beyond the BasicsWeb Page Test - Beyond the Basics
Web Page Test - Beyond the Basics
 
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache TuscanyS314011 - Developing Composite Applications for the Cloud with Apache Tuscany
S314011 - Developing Composite Applications for the Cloud with Apache Tuscany
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
How clean "semantic" markup can power simple Facebook Connect integrations
How clean "semantic" markup can power simple Facebook Connect integrationsHow clean "semantic" markup can power simple Facebook Connect integrations
How clean "semantic" markup can power simple Facebook Connect integrations
 
Nl when its just too slow
Nl when its just too slowNl when its just too slow
Nl when its just too slow
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
Responsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UIResponsive Layout Frameworks for XPages Application UI
Responsive Layout Frameworks for XPages Application UI
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
Brave new world of HTML5 - Interlink Conference Vancouver 04.06.2011
 
Developing High Performance Web Apps
Developing High Performance Web AppsDeveloping High Performance Web Apps
Developing High Performance Web Apps
 
Rest full
Rest fullRest full
Rest full
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
 
Profiling php applications
Profiling php applicationsProfiling php applications
Profiling php applications
 

Similar a WordPress Performance Optimization for Mere Mortals

Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereJohn Riviello
 
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit MavenBuilding Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit MavenOliver Ochs
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereJohn Riviello
 
Ensuring Design Standards with Web Components
Ensuring Design Standards with Web ComponentsEnsuring Design Standards with Web Components
Ensuring Design Standards with Web ComponentsJohn Riviello
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPrandyhoyt
 
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 2013Bastian Grimm
 
How Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web ApplicationsHow Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web ApplicationsDNN
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSZoe Gillenwater
 
14 Things You Must Do Before Launching a Website
14 Things You Must Do Before Launching a Website14 Things You Must Do Before Launching a Website
14 Things You Must Do Before Launching a WebsiteZero Point Development
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićMeetMagentoNY2014
 
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Jazkarta, Inc.
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceAdam Norwood
 
EECI2009 - From Design to Dynamic - Rapid ExpressionEngine Development
EECI2009 - From Design to Dynamic - Rapid ExpressionEngine DevelopmentEECI2009 - From Design to Dynamic - Rapid ExpressionEngine Development
EECI2009 - From Design to Dynamic - Rapid ExpressionEngine DevelopmentFortySeven Media
 
When dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWhen dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWim Godden
 
Changhao jiang facebook
Changhao jiang facebookChanghao jiang facebook
Changhao jiang facebookzipeng zhang
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Bastian Grimm
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersDistilled
 

Similar a WordPress Performance Optimization for Mere Mortals (20)

Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is Here
 
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit MavenBuilding Performance - ein Frontend-Build-Prozess für Java mit Maven
Building Performance - ein Frontend-Build-Prozess für Java mit Maven
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is Here
 
Ensuring Design Standards with Web Components
Ensuring Design Standards with Web ComponentsEnsuring Design Standards with Web Components
Ensuring Design Standards with Web Components
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHP
 
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
 
How Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web ApplicationsHow Evoq Helps You Build Modern Web Applications
How Evoq Helps You Build Modern Web Applications
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
 
14 Things You Must Do Before Launching a Website
14 Things You Must Do Before Launching a Website14 Things You Must Do Before Launching a Website
14 Things You Must Do Before Launching a Website
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje Jurišić
 
Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)Theming websites effortlessly with Deliverance (CMSExpo 2010)
Theming websites effortlessly with Deliverance (CMSExpo 2010)
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web Performance
 
EECI2009 - From Design to Dynamic - Rapid ExpressionEngine Development
EECI2009 - From Design to Dynamic - Rapid ExpressionEngine DevelopmentEECI2009 - From Design to Dynamic - Rapid ExpressionEngine Development
EECI2009 - From Design to Dynamic - Rapid ExpressionEngine Development
 
When dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniquesWhen dynamic becomes static - the next step in web caching techniques
When dynamic becomes static - the next step in web caching techniques
 
Ui dev@naukri-2011
Ui dev@naukri-2011Ui dev@naukri-2011
Ui dev@naukri-2011
 
Faster WordPress Workflows
Faster WordPress WorkflowsFaster WordPress Workflows
Faster WordPress Workflows
 
Changhao jiang facebook
Changhao jiang facebookChanghao jiang facebook
Changhao jiang facebook
 
Agile Wordpress
Agile WordpressAgile Wordpress
Agile Wordpress
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012
 
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital MarketersSearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
SearchLove San Diego 2018 | Mat Clayton | Site Speed for Digital Marketers
 

Último

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
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.pdfOrbitshub
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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 AmsterdamUiPathCommunity
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
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 REVIEWERMadyBayot
 

Último (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
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...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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
 

WordPress Performance Optimization for Mere Mortals

  • 1. John Levandowski @JohnLevandowski WordCamp Salt Lake City 2012 #wcslc The University of Utah @JohnLevandowski 1
  • 3.  Introduction  Tools  Compression  Browser Caching  Image Optimization  Let’s Get ‘r Done  Questions  Bonus Content @JohnLevandowski 3
  • 4.  Business Intelligence and Data Warehousing at the University of Utah  2005 - WordPress 1.5  Developed blog to deliver internal campus news  Syndicated content via RSS to campus portal @JohnLevandowski 4
  • 5.  WordPress 3.4.2  Hosted by Someone  Shared Hosting  Do not have root access to server  Concepts still apply  Use Apache Web Server  Concepts still apply @JohnLevandowski 5
  • 6.  Have Fun!  Learn at least one thing YOU CAN DO tomorrow @JohnLevandowski 6
  • 7.  A Fast WordPress Site is Cool  It’s also profitable $$$  Can save you $$$  Google cares about page speed  So do your customers @JohnLevandowski 7
  • 8.  Google Page Speed (Browser Extension)  http://developers.google.com/speed/pagespeed/  Yahoo Yslow Plugin (Browser Extension)  http://developer.yahoo.com/yslow/  GTmetrix  http://gtmetrix.com/ @JohnLevandowski 8
  • 9.  WebPageTest  http://www.webpagetest.org/  Pingdom Full Page Test  http://tools.pingdom.com/fpt/  Zoompf  http://zoompf.com/ @JohnLevandowski 9
  • 10.  Twenty Eleven Theme 1.4  No WordPress plugins  Page Speed Grade  YSlow Grade  Zoompf Score  Page Size @JohnLevandowski 10
  • 16.  DNS Lookup  Server Connection  Waiting  Content Transfer @JohnLevandowski 16
  • 17.  BACKUP your site before implementing any changes @JohnLevandowski 17
  • 18.  “A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration.”  WordPress configuration for “Pretty Permalinks” # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress @JohnLevandowski 18
  • 19. HTTP Compression and Minification @JohnLevandowski 19
  • 20.  “HTTP compression is a capability that can be built into web servers and web clients to make better use of available bandwidth, and provide faster transmission speeds between both.”  Gzip  style.css  Not Compressed  57,094 bytes  Compressed  11,347 bytes @JohnLevandowski 20
  • 21.  Add to .htaccess file: <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/javascript application/x- javascript </IfModule> @JohnLevandowski 21
  • 22.  “Minification is the process of removing all unnecessary characters from source code, without changing its functionality.”  YUI Compressor  http://refresh-sf.com/yui/ @JohnLevandowski 22
  • 23.  style.css  Not Minified  57,094 bytes  Minified  40,494 bytes  Minified and Compressed  8,208 bytes @JohnLevandowski 23
  • 24.  WordPress theme style.css required headers  http://codex.wordpress.org/Theme_Development  Change link to style.css in header.php to minified version  Original  <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />  Minified  <link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_directory_uri(); ?>/style- min.css" />  There are fancier ways to do this with filters, etc. @JohnLevandowski 24
  • 26.  Last-Modified and ETag  Weak caching headers – request to server needed  “Have you changed from the last time”  Expires and Cache-Control: max-age  Strong caching headers – no request to server needed  Cache static content  CSS  JavaScript  Images @JohnLevandowski 26
  • 27.  Add to .htaccess file: <IfModule mod_headers.c> Header unset ETag FileETag None </IfModule> @JohnLevandowski 27
  • 28.  Add to .htaccess file: <IfModule mod_expires.c> ExpiresActive on ExpiresByType image/jpeg "access plus 6 months" ExpiresByType image/png "access plus 6 months" ExpiresByType image/gif "access plus 6 months" ExpiresByType image/x-icon "access plus 6 months" ExpiresByType text/css "access plus 6 months" ExpiresByType application/javascript "access plus 6 months" ExpiresByType application/x-javascript "access plus 6 months" </IfModule> @JohnLevandowski 28
  • 29.  If you cache static content you should never change this content  Your frequent visitors will not see the change  If you change the content you need to change the URL to that content  Images – upload new image with different file name  CSS and JS – add version number to URLs  http://example.com/style.css?ver=3.4.2 @JohnLevandowski 29
  • 30.  Original  <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />  Minified  <link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_directory_uri(); ?>/style-min.css" />  Minified with Version  <link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_directory_uri(); ?>/style-min.css?ver=<?php echo filemtime( get_stylesheet_directory() . '/style-min.css' ); ?>" /> @JohnLevandowski 30
  • 31.  favicon.ico  Have one at the root of your website  Or inside your <head> section using a <link> tag @JohnLevandowski 31
  • 33. August 1, 2011 August 1, 2012 http://httparchive.org/interesting.php http://httparchive.org/interesting.php ?a=All&l=Aug%201%202011 ?a=All&l=Aug%201%202012 @JohnLevandowski 33
  • 35.  300 X 224 Pixels  600 X 448 Pixels @JohnLevandowski 35
  • 37.  300 X 224 Pixels  600 X 448 Pixels  57,854 bytes  57,749 bytes @JohnLevandowski 37
  • 38.  Lossless  allows the exact original data to be reconstructed from the compressed data  removing unnecessary comments, meta-data, and color profiles  Lossy  compresses data by discarding (losing) some of it  Images (JPEG)  Audio (MP3, AAC, Dolby Digital AC-3)  Blu-ray (MPEG-2, H.264/MPEG-4 AVC, VC-1) @JohnLevandowski 38
  • 39.  PNGOUT, AdvPNG, Pngcrush, OptiPNG, JpegOptim, jpegrescan, jpegtran, Gifsicle, pngquant, pngnq …  ImageOptim for Mac  http://imageoptim.com/  ImageAlpha for Mac  http://pngmini.com/  Convert from 24-bit to 8-bit PNG  Similar tools are available for Windows  http://smush.it/  http://www.jpegmini.com/ @JohnLevandowski 39
  • 40.  Do not scale images in browser  Resize image before uploading to intended display size  Exceptions for HiDPI Retina displays  <img height=“100" width=“100" alt=“Alt Text" src="http://example.com/wp- content/uploads/2012/09/image.jpg" title=“Title Text" class="alignnone size-full wp-image-1">  Image returned should natively be 100 x 100 pixels @JohnLevandowski 40
  • 41.  chessboard.jpg  comment-bubble.png  Original  Original  53,906 bytes  925 bytes  Optimized - 79% quality  Optimized  40,150 bytes  767 bytes @JohnLevandowski 41
  • 43. Original Optimized % of Original (bytes) (bytes) html page 7,551 2,342 31% style.css 57,094 8,208 14% chessboard.jpg 53,906 40,150 74% comment-bubble.png 925 767 83% search.png 441 441 100% TOTAL bytes 119,917 51,908 43% Page Speed 58 98 YSlow 91 97 Zoompf 61 92 @JohnLevandowski 43
  • 46.  Default jpeg quality is 90 for resized images  Change jpeg quality in functions.php /** Lower jpeg quality for media */ add_filter( 'jpeg_quality', 'wpselect_jpeg_quality' ); function wpselect_jpeg_quality( $quality ) { return (int)79; }  Insert code in a plugin or theme @JohnLevandowski 46
  • 47.  To reduce the number of requests the browser makes to the server  Combine numerous small images  CSS is used to select the parts of the composite image to display at different points in the page  http://spriteme.org/ @JohnLevandowski 47
  • 48.  WP Super Cache  W3 Total Cache @JohnLevandowski 48
  • 49.  @JohnLevandowski  http://wpselect.com/  http://en.gravatar.com/jlevandowski  Slides will soon be available at:  http://wpselect.com/ @JohnLevandowski 49
  • 50.  http://wpselect.com/blog/web-page-response-time/  http://wpselect.com/blog/optimize-wordpress-for-page- speed-yslow-and-zoompf/  http://wpselect.com/blog/wordpress-performance- opcode-cache/  http://wpselect.com/blog/optimize-images-for-web-jpeg/  http://wpselect.com/blog/optimize-images-for-web-png/ @JohnLevandowski 50
  • 51.  http://www.flickr.com/photos/vernhart/1574355646/  http://www.flickr.com/photos/joshfassbind/4683365102/  http://www.flickr.com/photos/mytudut/5188623575/  http://www.flickr.com/photos/left-hand/2863299383/  http://www.flickr.com/photos/wbob/4171615158/  http://www.flickr.com/photos/96dpi/466946465/  http://www.flickr.com/photos/62172402@N07/6237005541/  http://www.flickr.com/photos/russmorris/28389687/  http://www.flickr.com/photos/30928442@N08/3508534114/  http://www.flickr.com/photos/infelix/1449066379/  http://www.flickr.com/photos/tomitapio/5126337639/  http://www.flickr.com/photos/massenpunkt/91952193/  http://www.flickr.com/photos/dvids/4644922363/  http://www.flickr.com/photos/crystaljingsr/3914729343/  http://www.flickr.com/photos/wwworks/4759535950/ @JohnLevandowski 51