SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Kürzlich hochgeladen (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

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