“Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super...
Transcript of “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super...
![Page 1: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/1.jpg)
Josh HighlandNewLeafLabs.com www.NewLeafLabs.com
“Optimizing the performance of WordPress”
![Page 2: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/2.jpg)
Who is Josh?
Josh Highland - Computer Scientist
Born in San Bernardino, California
Founder of New Leaf Labs
Web & iPhone apps
WordPress since 2004 (1.2.1)
Social Media Addict (follow @JoshHighland)
![Page 3: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/3.jpg)
What we will cover?
Defining performance
Hosting choices
Server configurations
WordPress plugins
WordPress themes
Your content
Tools
![Page 4: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/4.jpg)
What is Performance?
The manner in which something reacts or fulfills its intended purposedictionary.com
How fast your WordPress site can deliver content
![Page 5: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/5.jpg)
Some reasons for a slow
Web host mismatch
Server configurations
Misbehaving plugins - heavy queries, 3rd party interactions
Not all WordPress themes are equal
The content you server up
![Page 6: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/6.jpg)
Shared Web Hosting
Most popular
Your site is on a server along with many others
The hosting company manage the web server for you
Little control over server settings and so on
Good for small site with little traffic
Very affordable
![Page 7: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/7.jpg)
Virtual / Dedicated Servers Dedicated hardware resources
Full control of server settings
Storage space
Often located in a hosting facility
Can get expensive
![Page 8: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/8.jpg)
Web Servers
Apache
Very popular
Lots of tuning resources available
Nginx
Faster than Apache
Harder to use
Used by WordPress, Hulu and Others
Only load the modules that you need! Keep it lean and mean.
![Page 9: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/9.jpg)
Caching? Remember the results of an action, use them again if possible
Greatly speeds up performance
Reduces load on the server
Transparent to the end user
Things you should be caching:
Data base queries
PHP code
Page requests
Assets (images, javasscript, css)
![Page 10: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/10.jpg)
MySQL Query Caching
Pros
Easy to enable (MySQL config file settings)
Instant performance gains
Reduces server load
Effects all apps on the server
Cons
Can be tough to tune properly
Consumes server RAM
![Page 11: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/11.jpg)
PHP OPCode CachingOpCode?
Readable PHP Code -> Compiler -> Opcode -> Executed
Popular Solutions
Eaccelarator
APC
Pros
Huge performance gains
Reduces server load
Cons
Can be hard to tune
RAM Usage
![Page 12: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/12.jpg)
![Page 13: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/13.jpg)
![Page 14: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/14.jpg)
WordPress Cache PluginsWP Super Cache
Very popular (1.5 million downloads!)
Creates and serves static pages
W3 Total Cache
Page caching
Object Caching
CSS / JS minifying (smaller sizes)
HTTP Compression
CDN Support
![Page 15: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/15.jpg)
WordPress Themes
Not 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 get
Do your home work
![Page 16: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/16.jpg)
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.
![Page 17: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/17.jpg)
PNG - 4 KBJPG - 131 KB
Practical Example
![Page 18: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/18.jpg)
Your Content - Widgets
3rd 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 dependencies
Think lean and mean!
![Page 19: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/19.jpg)
Your Content - PluginsBecause you can, doesn’t mean you should
Often the performance choking point on many sites
Only load what you need
Do you really need that plugin?
Increased database calls
Increased 3rd party dependencies
Case Study
Load time was 11 seconds
Disabled the “YARPP” (Yet another related posts plugin)
Load time was 4 seconds - huge improvement!
![Page 20: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/20.jpg)
Other Tweaks
Separate your web server and database server
Load Balancing
Multiple Servers - when one is busy, the next takes over
Apache .htaccess tweaks
improved re-write rules
Load jQuery from Google
wp-config tweaks
![Page 21: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/21.jpg)
Measuring PerformanceFrom The Browser
FireFox Browser
lori (life-of-request info) plugin
FireBug plugin
“Net” tab
YSlow
Google Speed
Advanced tools for server performance testing are available
![Page 22: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/22.jpg)
![Page 23: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/23.jpg)
![Page 24: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/24.jpg)
![Page 25: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/25.jpg)
![Page 26: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/26.jpg)
![Page 27: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/27.jpg)
![Page 28: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/28.jpg)
![Page 29: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/29.jpg)
![Page 30: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/30.jpg)
![Page 31: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/31.jpg)
ReviewHosting matters
Optimize your server
Hire a good system admin if you have to
Cache everything possible
Use a quality theme
Only use what you need
Be mindful of 3rd party connections
Firefox + Firebug are awesome
Everything in moderation
![Page 32: “Optimizing the performance of WordPress” · 2010-09-27 · WordPress Cache Plugins WP Super Cache Very popular (1.5 million downloads!) Creates and serves static pages W3 Total](https://reader034.fdocuments.us/reader034/viewer/2022050505/5f96db470aa06426e443e71d/html5/thumbnails/32.jpg)
Q & A
@JoshHighlandJoshHighland.com