Optimizing the performance of WordPress


Published on

Optimizing the performance of WordPress by Josh Highland of NewLeaf Labs. Presentation was given at Orange County WordCamp 2011

Published in: Technology, Business
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Optimizing the performance of WordPress

  1. 1. “Optimizing the performance of WordPress” Josh HighlandNewLeafLabs.comwww.NewLeafLabs.com
  2. 2. Who is Josh?Josh Highland - Computer ScientistRedlands, California (909!)Founder of New Leaf LabsWeb & iPhone appsWordPress since 2004 (1.2.1)Social Media Addict (follow @JoshHighland)
  3. 3. What we will cover? Defining performance Hosting choices Server configurations WordPress plugins WordPress themes Your content Tools
  4. 4. What is Performance?The manner in which something reacts or fulfills its intended purpose dictionary.com How fast your WordPress site can deliver content
  5. 5. Some reasons for a slowWeb host mismatchServer configurationsMisbehaving plugins - heavy queries, 3rd party interactionsNot all WordPress themes are equalThe content you server up
  6. 6. Shared Web HostingMost popularYour site is on a server along with many othersThe hosting company manage the web server for youLittle control over server settings and so onGood for small site with little trafficVery affordable
  7. 7. Virtual / Dedicated ServersDedicated hardware resourcesFull control of server settingsStorage spaceOften located in a hosting facilityCan get expensive
  8. 8. Web ServersApache Very popular Lots of tuning resources availableNginx Faster than Apache Harder to use Used by WordPress, Hulu and OthersOnly load the modules that you need! Keep it lean and mean.
  9. 9. Caching?Remember the results of an action, use them again if possibleGreatly speeds up performanceReduces load on the serverTransparent to the end userThings you should be caching: Data base queries PHP code Page requests Assets (images, javasscript, css)
  10. 10. MySQL Query CachingPros Easy to enable (MySQL config file settings) Instant performance gains Reduces server load Effects all apps on the serverCons Can be tough to tune properly Consumes server RAM
  11. 11. PHP OPCode CachingOpCode? Readable PHP Code -> Compiler -> Opcode -> ExecutedPopular Solutions Eaccelarator APCPros Huge performance gains Reduces server loadCons Can be hard to tune RAM Usage
  12. 12. WordPress Cache PluginsWP Super Cache Very popular (2.2 million downloads!) Creates and serves static pages CDN SupportW3 Total Cache Page caching CSS / JS minifying (smaller sizes) HTTP Compression CDN Support
  13. 13. WordPress ThemesNot all themes are created equal!Things to look for Number of CSS / JS / Images being loaded Are the CSS / JS files minified? Are the images optimized? Is the code optimized?Sometimes you pay for what you getDo your home work
  14. 14. Your Content - ImagesImages How many are you loading? Are the images optimized? Use the Photoshop “save for web” option Use the right file type Upload the file in the appropriate size Don’t resize the image in WP with the size %CDN - Content Delivery Network Image heavy sites should use a CDN Amazon S3, RackSpace Cloud, Akamai, etc.
  15. 15. Practical ExampleJPG - 147 KB PNG - 8 KB
  16. 16. Your Content - Widgets3rd party content widgets How many are you loading? Do you really need that widget? Your speed now depends on their speed Is their content optimized? Often not cached Often adds javascript / flash dependenciesThink lean and mean!
  17. 17. Your Content - PluginsBecause you can, doesn’t mean you shouldOften the performance choking point on many sitesOnly load what you needDo you really need that plugin? Increased database calls Increased 3rd party dependenciesCase Study Load time was 11 seconds Disabled the “YARPP” (Yet another related posts plugin) Load time was 4 seconds - huge improvement!
  18. 18. Other TweaksSeparate your web server and database serverLoad Balancing Multiple Servers - when one is busy, the next takes overApache .htaccess tweaks improved re-write rulesLoad jQuery from Googlewp-config tweaks
  19. 19. Measuring Performance From The BrowserFireFox Browser lori (life-of-request info) plugin FireBug plugin “Net” tab YSlow Google SpeedAdvanced tools for server performance testing are available
  20. 20. ReviewHosting mattersOptimize your server Hire a good system admin if you have toCache everything possibleUse a quality themeOnly use what you needBe mindful of 3rd party connectionsFirefox + Firebug are awesomeEverything in moderation
  21. 21. Q&A@JoshHighland JoshHighland.com