SlideShare a Scribd company logo
1 of 34
Download to read offline
The 5 most common reasons
for a slow WordPress site
and how to fix them
Otto Kekäläinen
@ottokekalainen
WP Berlin Meetup
23. Mai 2019
● A CEO who codes at Seravo.com
● Written WP themes and plugins,
contributed to WordPress Core,
MySQL, MariaDB, Debian,
Ubuntu, Linux kernel,
AppArmor…
● Linux and open source advocate
Otto Kekäläinen
The 5 most common reasons for a
slow WordPress site
1. Unnecessarily large image files
2. Too many HTTP requests and assets loaded in vain
3. Web servers that are slow or lack HTTP/2
4. Caches not working as they should
5. Code fetching too much external data before printing
out the WordPress HTML for visitors to see
1. Unnecessarily large
image files
Unnecessarily large image files
The pictures from modern mobile
phones are huge. A single image
from a 8 Mpix camera is easily 3
MB in size and 3840x2160 in
dimensions.
My laptop: 1920x1080
Iphone X: 2436x1125
On websites any image over
1000px per side is usually waste
of space.
Unnecessarily large image files
Check it yourself: press F12 to
open the developer console in a
browser.
See tab Network and check
image files Size and Time.
Unnecessarily large image files
Another tool: webpagetest.org
Unnecessarily large image files
Solution:
● Always use one of the image
sizes generated by
WordPress, never full size.
● Use open source
command-line tools like
optipng and jpegoptim to
optimize your images.
● There are also plugins that
send your images for
processing on a remote
server.
Unnecessarily large image files
Smart server environments and
development tools take care of image
optimization automatically.
wp-optimize-images
No path given as argument. Using default path.
Scanning for image files in
/data/wordpress/htdocs/wp-content/uploads/
Found 9 images in total and 6 new images.
...
---> Optimizing otto-normal-full-size-1568x2788.jpg ...
File size reduction: 360K --> 324K
Optimized image by: 10.3697 %
---> Optimizing otto-normal-full-size-169x300.jpg ...
File size reduction: 16K --> 16K
Optimized image by: 7.47187 %
---> Optimizing otto-normal-full-size.jpg ...
File size reduction: 868K --> 464K
Optimized image by: 46.6131 %
Optimized 6 images for a total of 463KiB saved!
Unnecessarily large image files
Remember to validate after changes!
2. Too many HTTP
requests and assets
loaded in vain
Too many HTTP requests and
assets loaded in vain
With the same web developer
console or webpagetest.org tool
you can see how many HTTP
requests were made and the total
size of download:
Solution:
● Uninstall unnecessary
plugins
● If you see a contact form
plugin load on every page,
report that as a bug to the
plugin author. It should load
it’s assets only on the page
where the contact form
actually is on.
If you see this in webpagetest.org
results then you know the
bandwidth of the visitor is
saturated:
Since you can’t increase the
visitors’ bandwidth, you must
slim down your site contents.
Front page should below 100 HTTP requests and 1000
kb, but 30 req and 300 kb is often doable with some
smart design.
Too many HTTP requests and
assets loaded in vain
Don’t try to solve
performance issues
by installing more
plugins!
Since WordPress 5.2 the core now has the Site Health page that also
recommends installing all unused plugins and themes, which is always a
good practice!
Too many HTTP requests and
assets loaded in vain
Too many HTTP requests and
assets loaded in vain
What about minification and
concatenation = combining many
.js and .css files into one?
Ensure your site is server
with HTTP/2 which has
similar features built into
the protocol.
With modern browsers and
HTTP/2 the benefits of
minification and
concatenation is marginal.
Use your developer time on
something else!
3. Web servers that are
slow or lack HTTP/2
The front page of a fresh
WordPress installation
should load in under 300
ms when tested on
webpagetest.org.
Click on the
request to see
details, and check
for HTTP/2.
Web servers that are slow or
lack HTTP/2
For developers: learn how to use
the command-line tool curl:
● Tests WordPress specifically
= HTML output of a site
● Shows headers as well.
● Does not cache, all redirects
et al are always really from
the server and not your
browser’s memory.
Web servers that are slow or
lack HTTP/2
curl -Ls https://example.com/article/ -o
/dev/null -w '%{http_code}
%{time_total}n'
200 0,341418
curl -ILs -H Pragma:no-cache seravo.com
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Thu, 23 May 2019 14:32:51 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://seravo.com/
Web servers that are slow or
lack HTTP/2
You get what you pay for with
hosting that costs only 2,95€ per
month. Don’t try to save 20 euros
in the wrong place, it won’t be
worth it once you get trouble!
A good hosting solution will not
only be much faster than
average, but also usually include
better technology (HTTP/2,
Redis caching, gzip
compression) and some
companies even offer upkeep
that covers monitoring, updates,
security and much more.
4. Caches not working as
they should
Caches not working as they should
Unfortunately the quality of many
WordPress plugins and themes
are low, and they do things that
bust the cache:
● emit cache denying headers
● set cookies for all visitors
HTTP caching is very important,
since when it works, the HTML
from WordPress/PHP does not
need to be fetched at all and
everything is much faster from
the server.
HTTP caching also happens in
the browser and what is fetched
from browser memory is very
quickly shown to the visitor!
Caches not working as they should
While webpagetest.org also
shows cache headers and
statuses, using curl is invaluable
since you can make changes on
the server validate it in an instant:
Look for headers like:
● cache-control
● expires
● age
● set-cookie
Good read:
https://developer.mozilla.org/e
n-US/docs/Web/HTTP/Caching
curl -ILs https://example.com/
HTTP/2 200
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-cache, must-revalidate,
max-age=0
Caches not working as they should
Cookies imply that there is a
session and that the HTML page
contents is individually tailored,
thus no caching.
Cookies should not be used for
language selection or for storing
cookie consent info (sic!).
The old PHPSESSION cookies
should not be in use anywhere
anymore!
On a WooCommerce site cookies
might make sense, since the
page might have a shopping cart
or a “Hello <name>” section that
is supposed to be shown to this
only one user.
Caches not working as they should
Remember, caching is also good for the environment!
(Prevents excess CPU cycles from happening.)
5. Code is doing too much
Code is doing too much
Typically developers don’t test
their plugins with large amounts
of data and they work well on
small sites.
As sites grow, all problems related
to excess data manipulation
become visible.
External API calls in PHP typically
also block the entire site from
loading if the external API is down.
Solution:
● Inject more data on a test
site and see how it behaves
● In code, don’t always fetch
everything from the
database. Remember
“LIMIT N” in SQL, OK?
● Design code to do only what
is needed for the view,
nothing else.
Code is doing too much
Finding the code bottlenecks is
hard without proper tools.
Solution:
● Code profiling
● XDebug on test sites
● Tideways on production
sites
Code is doing too much
XDebug + Webgrind
More at: https://seravo.com/docs/development/xdebug/
Code is doing too much
Tideways.com
– from Germany
More at: https://seravo.com/docs/development/tideways/
Code is doing too much
The database is often the
performance bottleneck. See my
other talk on WordPress and
database optimization:
More in-depth code profiling tips
in my WordPress performance
talk:
wordpress.tv/?s=otto+kekäläinen
Thank you!
@ottokekalainen
See you at WordCamp Europe?
Premium hosting
and upkeep for
WordPress
HTTP/2
TESTED
UPDATES
24/7 UPKEEP
0. Who is Otto and what is Seravo
a. Follow on Twitter to get slides
1. Too big image file sizes
a. Typical with modern mobile phones and on blogs
b. See it yourself in the developer console, page size should be <1MB
c. How to use webpagetest.org to measure it
d. Optimize images with open source tools yourself or install a plugin - Seravo has wp-optimize-images
2. Too many HTTP requests and assets loaded in vain
a. Look at web developer console how many requests are made on every page
b. Remove excess cruft, remove unnecessary plugins. WP 5.2 health check helps!
c. Don’t try to solve speed issues by installing more plugins!
d. Forget minification and concatenation - ensure you have HTTP/2 instead
3. Slow web server, cheap hosting, lack of HTTP/2
a. Fast web server - WP out of the box should load in 200 ms
b. How to use curl to measure it
c. Browser developer console
d. Hosting should cost closer 30-50 euros per month
e. Good hosting takes automatically care of many server side things, like HTTP caching, Redis based object caching, HTTP/2, gzip compression etc
4. Cache busted
a. How to use curl to see cache headers
b. Avoid cookies set in vain
i. WooCommerce OK
ii. Cookie consent or WPML is not OK use case for cookies
5. Code is doing too much
a. XDebug
b. Tideways
c. Database size often the culprit, see my other talk
d. See my WC Europe talk. See you this year as well?
6. Software Architect tips
a. Blocking JavaScript
b. AMP - don’t do it
c. Progressive web applications - the future

More Related Content

What's hot

WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017ElifTech
 
Crawl the entire web in 10 minutes...and just 100€
Crawl the entire web  in 10 minutes...and just 100€Crawl the entire web  in 10 minutes...and just 100€
Crawl the entire web in 10 minutes...and just 100€Danny Linden
 
How We Localize & Mobilize WP Sites - Pubcon 2013
How We Localize & Mobilize WP Sites - Pubcon 2013How We Localize & Mobilize WP Sites - Pubcon 2013
How We Localize & Mobilize WP Sites - Pubcon 2013Search Commander, Inc.
 
Reducing Server Resources: Improve Costs, SEO, Conversions & UX
Reducing Server Resources: Improve Costs, SEO, Conversions & UXReducing Server Resources: Improve Costs, SEO, Conversions & UX
Reducing Server Resources: Improve Costs, SEO, Conversions & UXMichael Jones
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web ArchitectureChamnap Chhorn
 
Speed Up Wordpress, Wordpress Horsepower
Speed Up Wordpress, Wordpress HorsepowerSpeed Up Wordpress, Wordpress Horsepower
Speed Up Wordpress, Wordpress HorsepowerRoss Johnson
 
Advanced SEO for Web Developers
Advanced SEO for Web DevelopersAdvanced SEO for Web Developers
Advanced SEO for Web DevelopersNathan Buggia
 
Overview of how to do SEO
Overview of how to do SEOOverview of how to do SEO
Overview of how to do SEOChris Finne
 
Heavy Web Optimization: Frontend
Heavy Web Optimization: FrontendHeavy Web Optimization: Frontend
Heavy Web Optimization: FrontendVõ Duy Tuấn
 
Getting More Traffic From Search Advanced Seo For Developers Presentation
Getting More Traffic From Search  Advanced Seo For Developers PresentationGetting More Traffic From Search  Advanced Seo For Developers Presentation
Getting More Traffic From Search Advanced Seo For Developers PresentationSeo Indonesia
 
International Site Speed Tweaks - ISS 2017 Barcelona
International Site Speed Tweaks - ISS 2017 BarcelonaInternational Site Speed Tweaks - ISS 2017 Barcelona
International Site Speed Tweaks - ISS 2017 BarcelonaBastian Grimm
 
Advanced Thesis Techniques and Tricks
Advanced Thesis Techniques and TricksAdvanced Thesis Techniques and Tricks
Advanced Thesis Techniques and TricksBrad Williams
 
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014Bastian Grimm
 
WordCamp Finland 2015 - WordPress Security
WordCamp Finland 2015 - WordPress SecurityWordCamp Finland 2015 - WordPress Security
WordCamp Finland 2015 - WordPress SecurityTiia Rantanen
 
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxEasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxrtCamp
 

What's hot (20)

WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
JS digest. Decemebr 2017
JS digest. Decemebr 2017JS digest. Decemebr 2017
JS digest. Decemebr 2017
 
.htaccess
.htaccess.htaccess
.htaccess
 
Crawl the entire web in 10 minutes...and just 100€
Crawl the entire web  in 10 minutes...and just 100€Crawl the entire web  in 10 minutes...and just 100€
Crawl the entire web in 10 minutes...and just 100€
 
How We Localize & Mobilize WP Sites - Pubcon 2013
How We Localize & Mobilize WP Sites - Pubcon 2013How We Localize & Mobilize WP Sites - Pubcon 2013
How We Localize & Mobilize WP Sites - Pubcon 2013
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
 
Reducing Server Resources: Improve Costs, SEO, Conversions & UX
Reducing Server Resources: Improve Costs, SEO, Conversions & UXReducing Server Resources: Improve Costs, SEO, Conversions & UX
Reducing Server Resources: Improve Costs, SEO, Conversions & UX
 
Html Optimization for SEO
Html Optimization for SEOHtml Optimization for SEO
Html Optimization for SEO
 
Introduction to Web Architecture
Introduction to Web ArchitectureIntroduction to Web Architecture
Introduction to Web Architecture
 
Speed Up Wordpress, Wordpress Horsepower
Speed Up Wordpress, Wordpress HorsepowerSpeed Up Wordpress, Wordpress Horsepower
Speed Up Wordpress, Wordpress Horsepower
 
Advanced SEO for Web Developers
Advanced SEO for Web DevelopersAdvanced SEO for Web Developers
Advanced SEO for Web Developers
 
Overview of how to do SEO
Overview of how to do SEOOverview of how to do SEO
Overview of how to do SEO
 
Heavy Web Optimization: Frontend
Heavy Web Optimization: FrontendHeavy Web Optimization: Frontend
Heavy Web Optimization: Frontend
 
Getting More Traffic From Search Advanced Seo For Developers Presentation
Getting More Traffic From Search  Advanced Seo For Developers PresentationGetting More Traffic From Search  Advanced Seo For Developers Presentation
Getting More Traffic From Search Advanced Seo For Developers Presentation
 
International Site Speed Tweaks - ISS 2017 Barcelona
International Site Speed Tweaks - ISS 2017 BarcelonaInternational Site Speed Tweaks - ISS 2017 Barcelona
International Site Speed Tweaks - ISS 2017 Barcelona
 
Advanced Thesis Techniques and Tricks
Advanced Thesis Techniques and TricksAdvanced Thesis Techniques and Tricks
Advanced Thesis Techniques and Tricks
 
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
The Need for Speed (5 Performance Optimization Tipps) - brightonSEO 2014
 
WordCamp Finland 2015 - WordPress Security
WordCamp Finland 2015 - WordPress SecurityWordCamp Finland 2015 - WordPress Security
WordCamp Finland 2015 - WordPress Security
 
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxEasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
 
The wp config.php
The wp config.phpThe wp config.php
The wp config.php
 

Similar to The 5 most common reasons for a slow WordPress site and how to fix them

High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax ApplicationsSiarhei Barysiuk
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testingRoman Ananev
 
Performance Tuning Web Apps - The Need For Speed
Performance Tuning Web Apps - The Need For SpeedPerformance Tuning Web Apps - The Need For Speed
Performance Tuning Web Apps - The Need For SpeedVijay Rayapati
 
High Performance Websites By Souders Steve
High Performance Websites By Souders SteveHigh Performance Websites By Souders Steve
High Performance Websites By Souders Stevew3guru
 
High Performance Web Sites
High Performance Web SitesHigh Performance Web Sites
High Performance Web SitesPáris Neto
 
Surviving Slashdot
Surviving SlashdotSurviving Slashdot
Surviving Slashdotjohnbuckman
 
improve website performance
improve website performanceimprove website performance
improve website performanceamit Sinha
 
High Performance Websites
High Performance WebsitesHigh Performance Websites
High Performance WebsitesParham
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeededm00se
 
Core Web Vitals Fixer
Core Web Vitals FixerCore Web Vitals Fixer
Core Web Vitals FixerTed Politidis
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站areyouok
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站topgeek
 
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
 
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional PerformanceNicole Sullivan
 
WordPress performance tuning
WordPress performance tuningWordPress performance tuning
WordPress performance tuningVladimír Smitka
 
A Holistic View of Website Performance
A Holistic View of Website PerformanceA Holistic View of Website Performance
A Holistic View of Website PerformanceRene Churchill
 
Demystifying web performance tooling and metrics
Demystifying web performance tooling and metricsDemystifying web performance tooling and metrics
Demystifying web performance tooling and metricsAnna Migas
 
Spreadshirt Techcamp 2018 - Hold until Told
Spreadshirt Techcamp 2018 - Hold until ToldSpreadshirt Techcamp 2018 - Hold until Told
Spreadshirt Techcamp 2018 - Hold until ToldMartin Breest
 

Similar to The 5 most common reasons for a slow WordPress site and how to fix them (20)

High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
 
Performance Tuning Web Apps - The Need For Speed
Performance Tuning Web Apps - The Need For SpeedPerformance Tuning Web Apps - The Need For Speed
Performance Tuning Web Apps - The Need For Speed
 
High Performance Websites By Souders Steve
High Performance Websites By Souders SteveHigh Performance Websites By Souders Steve
High Performance Websites By Souders Steve
 
Plop
PlopPlop
Plop
 
High Performance Web Sites
High Performance Web SitesHigh Performance Web Sites
High Performance Web Sites
 
Surviving Slashdot
Surviving SlashdotSurviving Slashdot
Surviving Slashdot
 
improve website performance
improve website performanceimprove website performance
improve website performance
 
High Performance Websites
High Performance WebsitesHigh Performance Websites
High Performance Websites
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Core Web Vitals Fixer
Core Web Vitals FixerCore Web Vitals Fixer
Core Web Vitals Fixer
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站
 
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站
 
23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress
 
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
 
7 Habits of Exceptional Performance
7 Habits of Exceptional Performance7 Habits of Exceptional Performance
7 Habits of Exceptional Performance
 
WordPress performance tuning
WordPress performance tuningWordPress performance tuning
WordPress performance tuning
 
A Holistic View of Website Performance
A Holistic View of Website PerformanceA Holistic View of Website Performance
A Holistic View of Website Performance
 
Demystifying web performance tooling and metrics
Demystifying web performance tooling and metricsDemystifying web performance tooling and metrics
Demystifying web performance tooling and metrics
 
Spreadshirt Techcamp 2018 - Hold until Told
Spreadshirt Techcamp 2018 - Hold until ToldSpreadshirt Techcamp 2018 - Hold until Told
Spreadshirt Techcamp 2018 - Hold until Told
 

More from Otto Kekäläinen

FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuFOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuOtto Kekäläinen
 
MariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuMariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuOtto Kekäläinen
 
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?Otto Kekäläinen
 
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...Otto Kekäläinen
 
DebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFDebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFOtto Kekäläinen
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressOtto Kekäläinen
 
Automatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesAutomatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesOtto Kekäläinen
 
Automatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsAutomatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsOtto Kekäläinen
 
Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Otto Kekäläinen
 
WordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetWordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetOtto Kekäläinen
 
Technical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionTechnical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionOtto Kekäläinen
 
Improving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingImproving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingOtto Kekäläinen
 
MariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsMariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsOtto Kekäläinen
 
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017Otto Kekäläinen
 
WordPress security 101 - WP Turku Meetup 2.2.2017
WordPress security 101 - WP Turku Meetup 2.2.2017WordPress security 101 - WP Turku Meetup 2.2.2017
WordPress security 101 - WP Turku Meetup 2.2.2017Otto Kekäläinen
 
Find WordPress performance bottlenecks with XDebug PHP profiling
Find WordPress performance bottlenecks with XDebug PHP profilingFind WordPress performance bottlenecks with XDebug PHP profiling
Find WordPress performance bottlenecks with XDebug PHP profilingOtto Kekäläinen
 
Testing and updating WordPress - Advanced techniques for avoiding regressions
Testing and updating WordPress - Advanced techniques for avoiding regressionsTesting and updating WordPress - Advanced techniques for avoiding regressions
Testing and updating WordPress - Advanced techniques for avoiding regressionsOtto Kekäläinen
 
MariaDB Developers Meetup 2016 welcome words
MariaDB Developers Meetup 2016 welcome wordsMariaDB Developers Meetup 2016 welcome words
MariaDB Developers Meetup 2016 welcome wordsOtto Kekäläinen
 

More from Otto Kekäläinen (20)

FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuFOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
 
MariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuMariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and Ubuntu
 
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
 
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
 
DebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFDebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoF
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPress
 
Technical SEO for WordPress
Technical SEO for WordPressTechnical SEO for WordPress
Technical SEO for WordPress
 
Automatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesAutomatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themes
 
Automatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsAutomatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress plugins
 
Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)
 
WordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetWordPress-tietoturvan perusteet
WordPress-tietoturvan perusteet
 
Technical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionTechnical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 edition
 
Improving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingImproving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP Profiling
 
MariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsMariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environments
 
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
 
WordPress security 101 - WP Turku Meetup 2.2.2017
WordPress security 101 - WP Turku Meetup 2.2.2017WordPress security 101 - WP Turku Meetup 2.2.2017
WordPress security 101 - WP Turku Meetup 2.2.2017
 
Find WordPress performance bottlenecks with XDebug PHP profiling
Find WordPress performance bottlenecks with XDebug PHP profilingFind WordPress performance bottlenecks with XDebug PHP profiling
Find WordPress performance bottlenecks with XDebug PHP profiling
 
Testing and updating WordPress - Advanced techniques for avoiding regressions
Testing and updating WordPress - Advanced techniques for avoiding regressionsTesting and updating WordPress - Advanced techniques for avoiding regressions
Testing and updating WordPress - Advanced techniques for avoiding regressions
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
MariaDB Developers Meetup 2016 welcome words
MariaDB Developers Meetup 2016 welcome wordsMariaDB Developers Meetup 2016 welcome words
MariaDB Developers Meetup 2016 welcome words
 

Recently uploaded

Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneCall girls in Ahmedabad High profile
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Deliverybabeytanya
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 

Recently uploaded (20)

Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
10.pdfMature Call girls in Dubai +971563133746 Dubai Call girls
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on DeliveryCall Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
Call Girls In Mumbai Central Mumbai ❤️ 9920874524 👈 Cash on Delivery
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 

The 5 most common reasons for a slow WordPress site and how to fix them

  • 1. The 5 most common reasons for a slow WordPress site and how to fix them Otto Kekäläinen @ottokekalainen WP Berlin Meetup 23. Mai 2019
  • 2. ● A CEO who codes at Seravo.com ● Written WP themes and plugins, contributed to WordPress Core, MySQL, MariaDB, Debian, Ubuntu, Linux kernel, AppArmor… ● Linux and open source advocate Otto Kekäläinen
  • 3. The 5 most common reasons for a slow WordPress site 1. Unnecessarily large image files 2. Too many HTTP requests and assets loaded in vain 3. Web servers that are slow or lack HTTP/2 4. Caches not working as they should 5. Code fetching too much external data before printing out the WordPress HTML for visitors to see
  • 5. Unnecessarily large image files The pictures from modern mobile phones are huge. A single image from a 8 Mpix camera is easily 3 MB in size and 3840x2160 in dimensions. My laptop: 1920x1080 Iphone X: 2436x1125 On websites any image over 1000px per side is usually waste of space.
  • 6. Unnecessarily large image files Check it yourself: press F12 to open the developer console in a browser. See tab Network and check image files Size and Time.
  • 7. Unnecessarily large image files Another tool: webpagetest.org
  • 8. Unnecessarily large image files Solution: ● Always use one of the image sizes generated by WordPress, never full size. ● Use open source command-line tools like optipng and jpegoptim to optimize your images. ● There are also plugins that send your images for processing on a remote server.
  • 9. Unnecessarily large image files Smart server environments and development tools take care of image optimization automatically. wp-optimize-images No path given as argument. Using default path. Scanning for image files in /data/wordpress/htdocs/wp-content/uploads/ Found 9 images in total and 6 new images. ... ---> Optimizing otto-normal-full-size-1568x2788.jpg ... File size reduction: 360K --> 324K Optimized image by: 10.3697 % ---> Optimizing otto-normal-full-size-169x300.jpg ... File size reduction: 16K --> 16K Optimized image by: 7.47187 % ---> Optimizing otto-normal-full-size.jpg ... File size reduction: 868K --> 464K Optimized image by: 46.6131 % Optimized 6 images for a total of 463KiB saved!
  • 10. Unnecessarily large image files Remember to validate after changes!
  • 11. 2. Too many HTTP requests and assets loaded in vain
  • 12. Too many HTTP requests and assets loaded in vain With the same web developer console or webpagetest.org tool you can see how many HTTP requests were made and the total size of download: Solution: ● Uninstall unnecessary plugins ● If you see a contact form plugin load on every page, report that as a bug to the plugin author. It should load it’s assets only on the page where the contact form actually is on.
  • 13. If you see this in webpagetest.org results then you know the bandwidth of the visitor is saturated: Since you can’t increase the visitors’ bandwidth, you must slim down your site contents. Front page should below 100 HTTP requests and 1000 kb, but 30 req and 300 kb is often doable with some smart design. Too many HTTP requests and assets loaded in vain
  • 14. Don’t try to solve performance issues by installing more plugins!
  • 15. Since WordPress 5.2 the core now has the Site Health page that also recommends installing all unused plugins and themes, which is always a good practice! Too many HTTP requests and assets loaded in vain
  • 16. Too many HTTP requests and assets loaded in vain What about minification and concatenation = combining many .js and .css files into one? Ensure your site is server with HTTP/2 which has similar features built into the protocol. With modern browsers and HTTP/2 the benefits of minification and concatenation is marginal. Use your developer time on something else!
  • 17. 3. Web servers that are slow or lack HTTP/2
  • 18. The front page of a fresh WordPress installation should load in under 300 ms when tested on webpagetest.org. Click on the request to see details, and check for HTTP/2. Web servers that are slow or lack HTTP/2
  • 19. For developers: learn how to use the command-line tool curl: ● Tests WordPress specifically = HTML output of a site ● Shows headers as well. ● Does not cache, all redirects et al are always really from the server and not your browser’s memory. Web servers that are slow or lack HTTP/2 curl -Ls https://example.com/article/ -o /dev/null -w '%{http_code} %{time_total}n' 200 0,341418 curl -ILs -H Pragma:no-cache seravo.com HTTP/1.1 301 Moved Permanently Server: nginx Date: Thu, 23 May 2019 14:32:51 GMT Content-Type: text/html Content-Length: 178 Connection: keep-alive Location: https://seravo.com/
  • 20. Web servers that are slow or lack HTTP/2 You get what you pay for with hosting that costs only 2,95€ per month. Don’t try to save 20 euros in the wrong place, it won’t be worth it once you get trouble! A good hosting solution will not only be much faster than average, but also usually include better technology (HTTP/2, Redis caching, gzip compression) and some companies even offer upkeep that covers monitoring, updates, security and much more.
  • 21. 4. Caches not working as they should
  • 22. Caches not working as they should Unfortunately the quality of many WordPress plugins and themes are low, and they do things that bust the cache: ● emit cache denying headers ● set cookies for all visitors HTTP caching is very important, since when it works, the HTML from WordPress/PHP does not need to be fetched at all and everything is much faster from the server. HTTP caching also happens in the browser and what is fetched from browser memory is very quickly shown to the visitor!
  • 23. Caches not working as they should While webpagetest.org also shows cache headers and statuses, using curl is invaluable since you can make changes on the server validate it in an instant: Look for headers like: ● cache-control ● expires ● age ● set-cookie Good read: https://developer.mozilla.org/e n-US/docs/Web/HTTP/Caching curl -ILs https://example.com/ HTTP/2 200 content-type: text/html; charset=UTF-8 vary: Accept-Encoding expires: Wed, 11 Jan 1984 05:00:00 GMT cache-control: no-cache, must-revalidate, max-age=0
  • 24. Caches not working as they should Cookies imply that there is a session and that the HTML page contents is individually tailored, thus no caching. Cookies should not be used for language selection or for storing cookie consent info (sic!). The old PHPSESSION cookies should not be in use anywhere anymore! On a WooCommerce site cookies might make sense, since the page might have a shopping cart or a “Hello <name>” section that is supposed to be shown to this only one user.
  • 25. Caches not working as they should Remember, caching is also good for the environment! (Prevents excess CPU cycles from happening.)
  • 26. 5. Code is doing too much
  • 27. Code is doing too much Typically developers don’t test their plugins with large amounts of data and they work well on small sites. As sites grow, all problems related to excess data manipulation become visible. External API calls in PHP typically also block the entire site from loading if the external API is down. Solution: ● Inject more data on a test site and see how it behaves ● In code, don’t always fetch everything from the database. Remember “LIMIT N” in SQL, OK? ● Design code to do only what is needed for the view, nothing else.
  • 28. Code is doing too much Finding the code bottlenecks is hard without proper tools. Solution: ● Code profiling ● XDebug on test sites ● Tideways on production sites
  • 29. Code is doing too much XDebug + Webgrind More at: https://seravo.com/docs/development/xdebug/
  • 30. Code is doing too much Tideways.com – from Germany More at: https://seravo.com/docs/development/tideways/
  • 31. Code is doing too much The database is often the performance bottleneck. See my other talk on WordPress and database optimization: More in-depth code profiling tips in my WordPress performance talk: wordpress.tv/?s=otto+kekäläinen
  • 32. Thank you! @ottokekalainen See you at WordCamp Europe?
  • 33. Premium hosting and upkeep for WordPress HTTP/2 TESTED UPDATES 24/7 UPKEEP
  • 34. 0. Who is Otto and what is Seravo a. Follow on Twitter to get slides 1. Too big image file sizes a. Typical with modern mobile phones and on blogs b. See it yourself in the developer console, page size should be <1MB c. How to use webpagetest.org to measure it d. Optimize images with open source tools yourself or install a plugin - Seravo has wp-optimize-images 2. Too many HTTP requests and assets loaded in vain a. Look at web developer console how many requests are made on every page b. Remove excess cruft, remove unnecessary plugins. WP 5.2 health check helps! c. Don’t try to solve speed issues by installing more plugins! d. Forget minification and concatenation - ensure you have HTTP/2 instead 3. Slow web server, cheap hosting, lack of HTTP/2 a. Fast web server - WP out of the box should load in 200 ms b. How to use curl to measure it c. Browser developer console d. Hosting should cost closer 30-50 euros per month e. Good hosting takes automatically care of many server side things, like HTTP caching, Redis based object caching, HTTP/2, gzip compression etc 4. Cache busted a. How to use curl to see cache headers b. Avoid cookies set in vain i. WooCommerce OK ii. Cookie consent or WPML is not OK use case for cookies 5. Code is doing too much a. XDebug b. Tideways c. Database size often the culprit, see my other talk d. See my WC Europe talk. See you this year as well? 6. Software Architect tips a. Blocking JavaScript b. AMP - don’t do it c. Progressive web applications - the future