SlideShare a Scribd company logo
WordPress Optimization
WordPress
Optimization
markkelnar | WP Engine
@renderandserve | howdy@wpengine.com
wpengine.com/optimizing-WordPress
WordCamp Atlanta 2012
WordPress Optimization
Who is this guy?
Head of Technology, System Administration, database,
product development at WP Engine
I'm not a power-point guy, please excuse my mistakes. If I had my way, this presentation would
look like this
class WCATL extends presentation
{
protected $name;
function __constructor()
{
parent::__constructor();
$this­>name = 'Word Camp Atlanta';
$this­>bg_color = '#808080';
}
}
$p = new WCATL();
$p­>scroll();
WordPress Optimization
Why are you here?
You want your site fast
Keep readers/customers on your site
Survive heavy visitor load
Scale – When you're on techcrunch, mashable or
daringfireball, you want to survive
WordPress Optimization
You are doing it wrong!
But you don't know it.
WordPress Optimization
Who are you?
Site admin, content contributor
Designer, theme developer
Plugin developer
Backend developer, admin, dba, etc.
WordPress Optimization
What can I optimize?
Hosting is about layers, but which one?
Layman's term, not that techno-jargon ...
HTML, CSS, JS, images, web server, database, WordPress,
theme, plugin, cache, minify
LAMP, TTL, CDN, cache, Apache, PHP, static content,
dynamic content
WordPress Optimization
Where do I start?
Use profiling tools to find your bottleneck
WP-Tuner
WPDB Profiling
WPspeedometer.com
Yslow
webpagetest.org
yougetsignal.com (reverse IP address)
Command line fun:
`ab -n 100 http://wpengine.com` (Apache Benchmark)
`curl -I wpengine.com` (that's a dash-eye)
WordPress Optimization
WordPress Optimization
CDN
Content Delivery Network
Have another service serve your static files (jpg, js, css) from their domain
Say that again? Off-load statics (jpg, png, css, js) so it doesn't load from your
web server
Store static files closer to end user – global proximity
Paths in your HTML point the browser to the CDN service:
cdn.yourdomain.com/wp-content/themes/image.png
Cloud cache service (CloudFlare), Amazon S3, etc
WordPress Optimization
CDN
Paths – It's all in what your HTML tells the browser
Without CDN
  <img src="http://markkelnar.com/wp­content/uploads/family.jpg" 
alt="shredder" />
With CDN
  <img src="http://mark.some­cdn­service.com/wp­
content/uploads/family.jpg" alt="shredder" />
When the service mark.some-cdn-service.com needs the image, after TTL has
expired, the cdn service loads (pulls) a fresh copy from markkelnar.com
WordPress Optimization
Off-loading content
Poor-man's CDN, serve images from Flickr
Amazon S3 – host entire site there, or even just statics
Use external source for comments, like disqus-comment-
system
Popular posts / related content metrics – outbrain, nrelate
WordPress Optimization
Reduce, reuse
WPSmush it plugin
Everytime you add an image, it does it for you. Yahoo! Smush all your existing
images.
Do the other fun front end developer things
Minimize HTTP requests – CSS sprites
CSS at the top of the page, JS at the bottom
Search for “Yahoo performance rules”
Ads on your page
Load them asynchronously or maybe iframe.
Are your ads cache busting? Do they have to?
WordPress Optimization
Load from multiple
sub-domains
yourdomain.com
good:
foo1.yourdomain.com, foo2.yourdomain.com
better:
foo1.otherdomain.com, foo2.otheromain2.com
Difficult to do. More overhead to configure and support.
WordPress Optimization
That's front end tweaks
Now what?
What good is a fast front end with a slow back end?
What if the back end can't handle what still comes through?
WordPress Optimization
Review your theme
Theme – know your theme. Did you buy it? Codex? Off the street?
HTML - does it validate?
CSS at the top, JS at the bottom (not inline)
PHP
- Any weird code (if it looks bad, it probably is)
- weary of file_get_contents() / fgets()
- base64_decode() (injected malware or unnecessarily compressed code)
WordPress Optimization
Pull your data wisely
What could possibly go bad here?
WordPress Optimization
Keep WP up to date
Why wouldn’t you?
Code optimizations, core changes,
security
WordPress Optimization
Unused plugins
- deactivate plugins you don’t use at all
- delete plugins you don’t use at all
WordPress Optimization
Bad PHP code
Poor use of DB calls, update/insert to DB on every page load
Don't scale under load, cripple the back end
Put stuff on wp-cron scheduler that pops too often.
Ex: (but not limited to)
- backupwordpress backwpup - broken-link-checker
- dynamic-related-posts - file-commander
- google-sitemap-generator - LinkMan (MyReviewPlugin Link
Man) - MyRP (MyReviewPlugin)
- wp-symposium-alerts
Beware of poor
performers
WordPress Optimization
RSS feed
How many requests to your blog are /feed?
Are you using a service like feedburner?
WordPress Optimization
Show me the cache!
Let's start with plugins
W3-Total-Cache, WPSuperCache
Has features to do CDN path rewrites, page and object and db caching,
minification, cache purging/clearing
WP-Minify
JS, CSS – remove white space, comments sent to end user (browser)
WordPress Optimization
Browser Caching
What is it? HTTP Cache-Control, Expires headers,
Entity Tags (ETags)
Already done for me? W3-Total-Cache,
WPSuperCache
Gzip compression on server and uncompressed in
browser
WordPress Optimization
Server side caching
What is it? saves bandwidth and improves performance
HTTP Accelerator server– reverse proxy caching behind nginx
Memcached server – object caching, persistent vs transients
opcode: caching compiled PHP code bytecode
object caching: in memory key-value storage for data, transients
page caching: full caching of HTML page
Tools for the job:
APC, Eaccerator, Xcache, Zend Optimizer, ionCube
WordPress Optimization
Web server
- Move as much as possible out of Apache
- Stand up Nginx in front of Apache (reverse proxy)
- Don't run your PHP in Apache at all, use PHP Fast CGI,
lighthttpd, etc.
- Server static files from disk in Nginx
- Put known redirects (301/302 in Nginx config)
- Move .htaccess rules to Apache httpd.conf or better yet
Nginx config.
- Google Page Speed Apache module
WordPress Optimization
MySQL DB
- Optimize tables, clean house
- PHPMyAdmin, OptimizeDB, manually
- Tables, Innodb (transactional, faster for writes) vs
MyISAM (can be less memory)
- Master/Slave replication + HyperDB
- dedicated server(s)
- turn on log and investigate mysql-slow.log
- database caching
- mysqltuner.pl
WordPress Optimization
If you're reading this, you're too
geeky
Server: metal server vs virtual or cloud instance
OS: *nix, sun, MS
Packages: compiled, package installed
Hardware: CPU + cores, memory, SSD disk drives
DB: MySQL, Percona,
WordPress Optimization
No-Nos
- Don't edit WP-core files (wp-includes, wp-admin)
- Amazon EC2 not silver bullet
- Beware of plugins that update database tables on every
page load. Use external resources.
WordPress Optimization
Q&A

More Related Content

What's hot

Optimizing WordPress (WordCamp Philly 2011)
Optimizing WordPress (WordCamp Philly 2011)Optimizing WordPress (WordCamp Philly 2011)
Optimizing WordPress (WordCamp Philly 2011)
Ben Metcalfe
 
Wordpress optimization
Wordpress optimizationWordpress optimization
Wordpress optimizationpaudelvinay
 
Caching 101
Caching 101Caching 101
Caching 101
Andy Melichar
 
RPC-CMS-Blog-Platforms
RPC-CMS-Blog-PlatformsRPC-CMS-Blog-Platforms
Optimize wordpress
Optimize wordpressOptimize wordpress
Optimize wordpress
David Parsons
 
WordPress Performance 101
WordPress Performance 101WordPress Performance 101
WordPress Performance 101
Bora Yalcin
 
Theming Wordpress for Your Showcases
Theming Wordpress for Your ShowcasesTheming Wordpress for Your Showcases
Theming Wordpress for Your ShowcasesJun Hu
 
23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress
Zero Point Development
 
High Performance WordPress
High Performance WordPressHigh Performance WordPress
High Performance WordPressvnsavage
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010Barry Abrahamson
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedAcquia
 
Creating Local WordPress Installs
Creating Local WordPress InstallsCreating Local WordPress Installs
Creating Local WordPress Installs
mcgaritydotme
 
Memcached: What is it and what does it do?
Memcached: What is it and what does it do?Memcached: What is it and what does it do?
Memcached: What is it and what does it do?
Brian Moon
 
Ui perf
Ui perfUi perf
HyperDB, MySQL Performance, & Flavors of MySQL
HyperDB, MySQL Performance, & Flavors of MySQLHyperDB, MySQL Performance, & Flavors of MySQL
HyperDB, MySQL Performance, & Flavors of MySQL
Evan Volgas
 
Speeding Up WordPress sites
Speeding Up WordPress sitesSpeeding Up WordPress sites
Speeding Up WordPress sites
Jason Yingling
 
Ithemes presentation
Ithemes presentationIthemes presentation
Ithemes presentation
Jason Yingling
 
Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance
Dave Olsen
 
Front end optimization
Front end optimizationFront end optimization
Front end optimizationAbhishek Anand
 
Front-End Performance Optimizing
Front-End Performance OptimizingFront-End Performance Optimizing
Front-End Performance Optimizing
Michael Pehl
 

What's hot (20)

Optimizing WordPress (WordCamp Philly 2011)
Optimizing WordPress (WordCamp Philly 2011)Optimizing WordPress (WordCamp Philly 2011)
Optimizing WordPress (WordCamp Philly 2011)
 
Wordpress optimization
Wordpress optimizationWordpress optimization
Wordpress optimization
 
Caching 101
Caching 101Caching 101
Caching 101
 
RPC-CMS-Blog-Platforms
RPC-CMS-Blog-PlatformsRPC-CMS-Blog-Platforms
RPC-CMS-Blog-Platforms
 
Optimize wordpress
Optimize wordpressOptimize wordpress
Optimize wordpress
 
WordPress Performance 101
WordPress Performance 101WordPress Performance 101
WordPress Performance 101
 
Theming Wordpress for Your Showcases
Theming Wordpress for Your ShowcasesTheming Wordpress for Your Showcases
Theming Wordpress for Your Showcases
 
23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress
 
High Performance WordPress
High Performance WordPressHigh Performance WordPress
High Performance WordPress
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with Memcached
 
Creating Local WordPress Installs
Creating Local WordPress InstallsCreating Local WordPress Installs
Creating Local WordPress Installs
 
Memcached: What is it and what does it do?
Memcached: What is it and what does it do?Memcached: What is it and what does it do?
Memcached: What is it and what does it do?
 
Ui perf
Ui perfUi perf
Ui perf
 
HyperDB, MySQL Performance, & Flavors of MySQL
HyperDB, MySQL Performance, & Flavors of MySQLHyperDB, MySQL Performance, & Flavors of MySQL
HyperDB, MySQL Performance, & Flavors of MySQL
 
Speeding Up WordPress sites
Speeding Up WordPress sitesSpeeding Up WordPress sites
Speeding Up WordPress sites
 
Ithemes presentation
Ithemes presentationIthemes presentation
Ithemes presentation
 
Measuring Web Performance
Measuring Web Performance Measuring Web Performance
Measuring Web Performance
 
Front end optimization
Front end optimizationFront end optimization
Front end optimization
 
Front-End Performance Optimizing
Front-End Performance OptimizingFront-End Performance Optimizing
Front-End Performance Optimizing
 

Similar to Optimizing wp

Caching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourCaching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTour
Wim Godden
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
Chris Finne
 
Speeding up your WordPress site - WordCamp Hamilton 2015
Speeding up your WordPress site - WordCamp Hamilton 2015Speeding up your WordPress site - WordCamp Hamilton 2015
Speeding up your WordPress site - WordCamp Hamilton 2015
Alan Lok
 
Vinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress siteVinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress sitewpnepal
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019
Anam Ahmed
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Jonathan Klein
 
Rock Solid WordPress
Rock Solid WordPressRock Solid WordPress
Rock Solid WordPress
Erik Osterman
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
Wim Godden
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
Anup Hariharan Nair
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
Andy Kucharski
 
Website optimization
Website optimizationWebsite optimization
Website optimization
Mindfire Solutions
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Evan Mullins
 
Sofia WP User Group Presentation
Sofia WP User Group PresentationSofia WP User Group Presentation
Sofia WP User Group Presentation
Daniel Kanchev
 
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
WordCamp Harare
 
WordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = SuccessWordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = Success
Anthony Somerset
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
William Chong
 
Php go vrooom!
Php go vrooom!Php go vrooom!
Php go vrooom!
Elizabeth Smith
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
Matteo Moretti
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHP
randyhoyt
 

Similar to Optimizing wp (20)

Caching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourCaching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTour
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
 
Speeding up your WordPress site - WordCamp Hamilton 2015
Speeding up your WordPress site - WordCamp Hamilton 2015Speeding up your WordPress site - WordCamp Hamilton 2015
Speeding up your WordPress site - WordCamp Hamilton 2015
 
Vinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress siteVinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress site
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
 
Rock Solid WordPress
Rock Solid WordPressRock Solid WordPress
Rock Solid WordPress
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
Website optimization
Website optimizationWebsite optimization
Website optimization
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
Sofia WP User Group Presentation
Sofia WP User Group PresentationSofia WP User Group Presentation
Sofia WP User Group Presentation
 
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
 
WordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = SuccessWordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = Success
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
 
Php go vrooom!
Php go vrooom!Php go vrooom!
Php go vrooom!
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHP
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 

Optimizing wp

  • 1. WordPress Optimization WordPress Optimization markkelnar | WP Engine @renderandserve | howdy@wpengine.com wpengine.com/optimizing-WordPress WordCamp Atlanta 2012
  • 2. WordPress Optimization Who is this guy? Head of Technology, System Administration, database, product development at WP Engine I'm not a power-point guy, please excuse my mistakes. If I had my way, this presentation would look like this class WCATL extends presentation { protected $name; function __constructor() { parent::__constructor(); $this­>name = 'Word Camp Atlanta'; $this­>bg_color = '#808080'; } } $p = new WCATL(); $p­>scroll();
  • 3. WordPress Optimization Why are you here? You want your site fast Keep readers/customers on your site Survive heavy visitor load Scale – When you're on techcrunch, mashable or daringfireball, you want to survive
  • 4. WordPress Optimization You are doing it wrong! But you don't know it.
  • 5. WordPress Optimization Who are you? Site admin, content contributor Designer, theme developer Plugin developer Backend developer, admin, dba, etc.
  • 6. WordPress Optimization What can I optimize? Hosting is about layers, but which one? Layman's term, not that techno-jargon ... HTML, CSS, JS, images, web server, database, WordPress, theme, plugin, cache, minify LAMP, TTL, CDN, cache, Apache, PHP, static content, dynamic content
  • 7. WordPress Optimization Where do I start? Use profiling tools to find your bottleneck WP-Tuner WPDB Profiling WPspeedometer.com Yslow webpagetest.org yougetsignal.com (reverse IP address) Command line fun: `ab -n 100 http://wpengine.com` (Apache Benchmark) `curl -I wpengine.com` (that's a dash-eye)
  • 9. WordPress Optimization CDN Content Delivery Network Have another service serve your static files (jpg, js, css) from their domain Say that again? Off-load statics (jpg, png, css, js) so it doesn't load from your web server Store static files closer to end user – global proximity Paths in your HTML point the browser to the CDN service: cdn.yourdomain.com/wp-content/themes/image.png Cloud cache service (CloudFlare), Amazon S3, etc
  • 10. WordPress Optimization CDN Paths – It's all in what your HTML tells the browser Without CDN   <img src="http://markkelnar.com/wp­content/uploads/family.jpg"  alt="shredder" /> With CDN   <img src="http://mark.some­cdn­service.com/wp­ content/uploads/family.jpg" alt="shredder" /> When the service mark.some-cdn-service.com needs the image, after TTL has expired, the cdn service loads (pulls) a fresh copy from markkelnar.com
  • 11. WordPress Optimization Off-loading content Poor-man's CDN, serve images from Flickr Amazon S3 – host entire site there, or even just statics Use external source for comments, like disqus-comment- system Popular posts / related content metrics – outbrain, nrelate
  • 12. WordPress Optimization Reduce, reuse WPSmush it plugin Everytime you add an image, it does it for you. Yahoo! Smush all your existing images. Do the other fun front end developer things Minimize HTTP requests – CSS sprites CSS at the top of the page, JS at the bottom Search for “Yahoo performance rules” Ads on your page Load them asynchronously or maybe iframe. Are your ads cache busting? Do they have to?
  • 13. WordPress Optimization Load from multiple sub-domains yourdomain.com good: foo1.yourdomain.com, foo2.yourdomain.com better: foo1.otherdomain.com, foo2.otheromain2.com Difficult to do. More overhead to configure and support.
  • 14. WordPress Optimization That's front end tweaks Now what? What good is a fast front end with a slow back end? What if the back end can't handle what still comes through?
  • 15. WordPress Optimization Review your theme Theme – know your theme. Did you buy it? Codex? Off the street? HTML - does it validate? CSS at the top, JS at the bottom (not inline) PHP - Any weird code (if it looks bad, it probably is) - weary of file_get_contents() / fgets() - base64_decode() (injected malware or unnecessarily compressed code)
  • 16. WordPress Optimization Pull your data wisely What could possibly go bad here?
  • 17. WordPress Optimization Keep WP up to date Why wouldn’t you? Code optimizations, core changes, security
  • 18. WordPress Optimization Unused plugins - deactivate plugins you don’t use at all - delete plugins you don’t use at all
  • 19. WordPress Optimization Bad PHP code Poor use of DB calls, update/insert to DB on every page load Don't scale under load, cripple the back end Put stuff on wp-cron scheduler that pops too often. Ex: (but not limited to) - backupwordpress backwpup - broken-link-checker - dynamic-related-posts - file-commander - google-sitemap-generator - LinkMan (MyReviewPlugin Link Man) - MyRP (MyReviewPlugin) - wp-symposium-alerts Beware of poor performers
  • 20. WordPress Optimization RSS feed How many requests to your blog are /feed? Are you using a service like feedburner?
  • 21. WordPress Optimization Show me the cache! Let's start with plugins W3-Total-Cache, WPSuperCache Has features to do CDN path rewrites, page and object and db caching, minification, cache purging/clearing WP-Minify JS, CSS – remove white space, comments sent to end user (browser)
  • 22. WordPress Optimization Browser Caching What is it? HTTP Cache-Control, Expires headers, Entity Tags (ETags) Already done for me? W3-Total-Cache, WPSuperCache Gzip compression on server and uncompressed in browser
  • 23. WordPress Optimization Server side caching What is it? saves bandwidth and improves performance HTTP Accelerator server– reverse proxy caching behind nginx Memcached server – object caching, persistent vs transients opcode: caching compiled PHP code bytecode object caching: in memory key-value storage for data, transients page caching: full caching of HTML page Tools for the job: APC, Eaccerator, Xcache, Zend Optimizer, ionCube
  • 24. WordPress Optimization Web server - Move as much as possible out of Apache - Stand up Nginx in front of Apache (reverse proxy) - Don't run your PHP in Apache at all, use PHP Fast CGI, lighthttpd, etc. - Server static files from disk in Nginx - Put known redirects (301/302 in Nginx config) - Move .htaccess rules to Apache httpd.conf or better yet Nginx config. - Google Page Speed Apache module
  • 25. WordPress Optimization MySQL DB - Optimize tables, clean house - PHPMyAdmin, OptimizeDB, manually - Tables, Innodb (transactional, faster for writes) vs MyISAM (can be less memory) - Master/Slave replication + HyperDB - dedicated server(s) - turn on log and investigate mysql-slow.log - database caching - mysqltuner.pl
  • 26. WordPress Optimization If you're reading this, you're too geeky Server: metal server vs virtual or cloud instance OS: *nix, sun, MS Packages: compiled, package installed Hardware: CPU + cores, memory, SSD disk drives DB: MySQL, Percona,
  • 27. WordPress Optimization No-Nos - Don't edit WP-core files (wp-includes, wp-admin) - Amazon EC2 not silver bullet - Beware of plugins that update database tables on every page load. Use external resources.