Did you know the average user will wait only 2-3 seconds waiting for a webpage to load before abandoning it forever? Having a fast website is critical to its success. How do you ensure your site loads fast and reliably, to all kinds of users around the world? In this presentation we’ll discuss seven strategies for increasing your WordPress site’s speed.
Covering caching, content delivery networks, image optimization, file optimization, database cleaning, and hosting and theme choices, you’re guaranteed to leave this presentation with concrete next steps for improving your site’s performance:
Understand many components that go into determining site speed.
Use free tools to measure and monitor speed and performance of WordPress-based websites.
Create and modify websites to perform faster, better, stronger!
1. Speed Up
Your Site!
7 WAYS TO PUT YOUR WEBSITE ON THE FAST TRACK
#WCTO 2015 – MEAGAN HANES - @MHANES
Slides!
http://goo.gl/
AfR9YF
2. About Meagan
15+ years coding websites
Started using WordPress in 2005
Works on sites as small as ants & as large as elephants
Favourite Colour: Rainbow!
Follow: @mhanes on Twitter
3. Why is speed important?
User Satisfaction & Audience Building
Slow site = unhappy users, won’t return
Affects your PageRank
Slow site = lower rank in Google, harder to be found
Impacts Sales and Success of Website
Slow site = higher abandonment rates, marketing dollars wasted
And many, many more reasons why…
Like bragging rights!!
4. Recipe: Speed Up Pie
Serves One Website
Theme
Choice
Plugins
File
Optimization
Image Optimization
Caching
CDNs
Database
Cleanup
5. Theme Choice
Pretty, but at what cost?
Not all themes are created equal!
Twenty Fifteen: 328KB, 13 files, 0.6s
Premium Themes: 850KB – 2.5MB, 40+ files, 1.5-3.0s
More features + plugins = more bloat
Be specific with your theme needs!
What can be done via plugins or functions.php?
Use a fast framework, or try a different theme
Measure, measure, measure!
GTMetrix, Pingdom, Webpagetest
6. Plugins
More plugins, more problems
Each plugin you use adds overhead to your site.
Even admin-only plugins!
Get Data: P3 (Plugin Performance Profiler)
Don’t need it? Deactivate and delete it!
Add simple plugin functionality to functions.php
Turning off all comments, adding custom post types, etc
Disable plugins on unneeded pages – Plugin
Organizer by Jeff Sterup
May cause troubles, so test, test, test!
Advanced Coders: You can also load plugins via a
custom taxonomy + functions.php!1
7. File Optimization
File this under ‘u’ for ‘useful’
Minify CSS and JavaScript
Remove unneeded whitespace, padding, simplify variable names
Makes code not easily readable by humans
BWP Minify Plugin
Defer JavaScript
Wait to load JS until page is loaded
Achieve via BWP Minify or manually
<script source=“myScript.js” defer>
Google PageSpeed Insights = your best friend for more information
WARNING: Back up before playing with these!
8. Image Optimizing
Not all of us have high speed connections!
NEVER use images for text – unreadable by SEO!
Use only the image dimensions you need
Full Camera image size: 3000x2400 pixels, ~2MB
Common web size: 640x480, ~40KB
That’s over 50 times smaller!
Use the correct file type for your purpose
JPG: Rich Photos PNG: Vector/Transparency GIF: <256 Colours/Animated
Compress the file!
TinyPNG, TinyJPG, EZGIF
Refer to Google’s Image Optimization Guide1
9. Caching
Make it once, serve it over and over!
Serves static HTML vs dynamic database calls
Perfect for sites where content changes rarely
Also great when viewers won’t be logging in to see custom content
Many premium hosts (WPEngine) do this for you!
#1 caching plugin: WP Super Cache
“What about Queries?”
Transients API Query Caching1
Query Optimization2
http://www.wpbeginner.com/wp-tutorials/speed-up-
your-wordpress-by-caching-custom-queries-using-
transients-api/
10. CDNs
No, it doesn’t stand for Canadian ;)
Deliver files from server closest to viewer
You wouldn’t order a pizza from another province, right?
Saves connection time, network hops
Distributes load when one server is overwhelmed
Best for when concurrent users, server stress is your bottleneck
Use them if it makes sense!
CloudFlare (free for basic accounts)
MaxCDN (what the pros use)
11. Database Cleanup
Oh yay, Spring Cleaning time!
More records = more time spent combing through them
Many are of no actual value:
Spam and unapproved comments
Old Page + Post Revisions
Items trashed but not purged
Leftover cruft from deleted plugins
Solution: WP-Optimize (https://wordpress.org/plugins/wp-optimize/)
Feeling brave? Play with phpMyAdmin!
WARNING: BACK UP FIRST!!
Don’t say I didn’t warn you.
12. Warp Speed, Captain!
Many factors influence site speed
Measure, Report, Improve!
Any step forward is a good step
Questions? Ideas?
Slides: http://goo.gl/AfR9YF
@mhanes