WordPress Site Speed WordPress Maui Meetup - October 15, 2015
Why Does Speed Matter? • A ff ects Google ranking and page crawling since 2010 • Akamai survey: 75% of the 1,058 people asked would not return to websites that took longer than 4 seconds to load • 64% of smartphone users expect pages to load in less than 4 seconds
Back To School Traffic: 2014 vs. 2015 • 2014: 60% desktop, 33% smartphone • Smartphone average load time: ~5.5 seconds • 2015: 65% smartphone, 25% desktop • Smartphone average load time: ~2.5 seconds http://www.soasta.com/blog/back-to-school-website-performance-monitoring/
Let’s Say Your Blog Goes Viral. • $9 / month server • 5 million people in one week • 9000 visitors at once • How do you keep your website fast? (And up and running?)
The Players In The Speed Game • You. (Your web browser) • Your server. (Web hosting) • How does WordPress build a page from your theme, plugins, content, and media? • PHP code running on web server puts it all together • Where does WordPress store page / post content and other data? • Self-contained SQL database
What Happens When You Visit A WordPress Website? • Your web browser requests page • PHP code on server starts to build the HTML for your web page This entire process determines • The server requests the data it needs from the WordPress Time To First Byte or database First Byte Time . • Database runs query and returns result to server Time To First Byte is the amount of time it • Server inserts the database data into the HTML of your web page takes your web browser to receive the very first • Server sends the HTML back to your browser when the page is byte of data back from ready. your server. • Your web browser begins to receive data from the server and load the page
Your Browser Takes Over… • How many requests does your web browser make to load a single page? • Images, CSS, JavaScript, and many other fi les are loaded separately. • Some fi les are required for the page to load in your browser. This is called Time To First View - the amount of time it takes for the web page to load in your browser. • Other fi les can be loaded after the page fi rst loads. This is called deferring or loading fi les asynchronously.
What Slows Down WordPress? • Server has to build each page every time a browser requests it. • Server has to read from the database every time the page loads. • Your server delivers images, CSS, JavaScript, and other fi les to your browser every time a page loads. • Your browser downloads images, CSS, JavaScript, and other fi les every time a page loads.
What Is A Cache? And Why? • A cache is any data that is stored in a location where it can be quickly accessed. • Why do we cache data? • Stores work the server has already done, which reduces processor load. Your server doesn’t have to do the same job over and over again. • Reduces the amount of information that needs to be sent over the internet because cached data can be reused. • Increases responsiveness of websites - and user experience!
What Is A CDN? • CDN stands for Content Delivery Network - a super-fast worldwide network of servers that delivers images, CSS, JavaScript, and other fi les to users based on their location. • A CDN is a cache! • CDNs reduce the load on your server. Visitors download fi les from the CDN, not your server. • CloudFlare is awesome. And free. And it protects your website from attackers.
How Do We Speed Things Up? • Server has to build each page every time a browser requests it. Page Cache • Server has to read from the database every time the page Database / Object Cache loads. • Your server delivers images, CSS, JavaScript, and other fi les to CDN (Content Delivery Network) your browser every time a page loads. • Your browser downloads images, CSS, JavaScript, and other Browser Cache fi les every time a page loads.
WordPress Plugins • W3 Total Cache • Turn on Page Cache, Browser Cache, Database Cache, Object Cache. • Turn on Minify if you’re not using CloudFlare. (CloudFlare does it automatically.) • If you are using CloudFlare, Go to Extensions -> Activate CloudFlare and con fi gure in General Settings. • Good con fi guration guide: http://www.inspire2rise.com/w3-total- cache-settings.html
Other Plugins For Speed • WP Smush - Good image compressor • Regenerate Thumbnails - Resizes images to theme sizes • Imsanity - Automatically scales down huge images • P3 (Plugin Performance Pro fi ler) - Measures which plugins are dragging down performance
Great Sites • webpagetest.org - My fave. Multiple tests at once. Check out the waterfall. • showslow.com - Great automatic monitoring and compilation of stats. • uptimerobot.com - Get noti fi ed if your site goes down - and track response time.
David Payette @payetteforward www.payetteforward.com
Recommend
More recommend