Speeding up WordPress
Jason Yingling
@jason_yingling
Jasonyingling.me
Where to Test
• Google Pagespeed Insights -
https://developers.google.com/speed/pagesp
eed/insights/
• GT Metrix - https://gtmetrix.com/
Pick good hosting
• Helps:
– Reduce server response time
– Leverage browser caching
– Enable compression
Server Speedup
Setup Cloudflare
• Easily minify and concatenate HTML, CSS, JS
• Bundle and load JS asynchronously
• Cache files
• Helps with:
– Minify CSS
– Minify HTML
– Minify Javascript
– Minify request size
– Prefer asynchronous resources
– Defer parsing of JS
Setup Caching
• Store static files in a cache so they are
accessed faster
• Most hosts have some form of caching
available
• Plugins:
– W3 Total Cache
• Helps:
– Leverage browser caching
Enable Compression
• Gzip it up via .htaccess or your host
• https://codex.wordpress.org/Output_Compre
ssion
• http://winningwp.com/how-to-enable-gzip-
compression-for-wordpress/
• Helps:
– Enable compression
Optimize Your Content
Crop and Resize Images
• Images make up > 60% of average site file size
• Don’t upload massive 3000 x 3000 images for a 150 x 150
square
• Editor Tip:
– Use Photoshop or Canva to crop images to smaller sizes
– https://photo-editor.canva.com/
• Developer Tip:
– Use add_image_size() to create thumbnail sizes to use within
themes
• Helps:
– Minimize request size
– Serve scaled images
– Optimize images
Optimize Images
• Reduce the file size of images
• ImageOptim
• Plugins
– WP Smush It
– Kraken.io
• Helps:
– Optimize images
Optimize Content
• Use embeds sparingly
– They’re nice but can load slow
• Be aware of what plugins add
– More JS
– More CSS
• Helps:
– Minimize request size
– Defer parsing of Javascript
Plugins
Jetpack Photon
• CDN for images
– Serves images from WordPress.com
• Scales images it serves to the browser
• Performs “blur up” method of loading
• Helps:
– Serve scaled images
– Use a Content Delivery Network (CDN)
– Optimize images
Autoptimize
• Minify and concatenate CSS and JS
• Works with scripts enqueued by plugins
• Helps:
– Minify HTML
– Minify CSS
– Minify JS
– Minimize request size
– Make fewer http requests
a3 Lazy Load
• Easily lazy load images and iframes below the
fold
• Helps:
– Defer parsing of Javascript
– Minimize request size
– Reduce server response time
– Prioritize visible content
– Eliminate render-blocking Javascript and CSS in
above-the-fold content

Speeding Up WordPress sites

  • 1.
    Speeding up WordPress JasonYingling @jason_yingling Jasonyingling.me
  • 2.
    Where to Test •Google Pagespeed Insights - https://developers.google.com/speed/pagesp eed/insights/ • GT Metrix - https://gtmetrix.com/
  • 3.
    Pick good hosting •Helps: – Reduce server response time – Leverage browser caching – Enable compression
  • 4.
  • 5.
    Setup Cloudflare • Easilyminify and concatenate HTML, CSS, JS • Bundle and load JS asynchronously • Cache files • Helps with: – Minify CSS – Minify HTML – Minify Javascript – Minify request size – Prefer asynchronous resources – Defer parsing of JS
  • 6.
    Setup Caching • Storestatic files in a cache so they are accessed faster • Most hosts have some form of caching available • Plugins: – W3 Total Cache • Helps: – Leverage browser caching
  • 7.
    Enable Compression • Gzipit up via .htaccess or your host • https://codex.wordpress.org/Output_Compre ssion • http://winningwp.com/how-to-enable-gzip- compression-for-wordpress/ • Helps: – Enable compression
  • 8.
  • 9.
    Crop and ResizeImages • Images make up > 60% of average site file size • Don’t upload massive 3000 x 3000 images for a 150 x 150 square • Editor Tip: – Use Photoshop or Canva to crop images to smaller sizes – https://photo-editor.canva.com/ • Developer Tip: – Use add_image_size() to create thumbnail sizes to use within themes • Helps: – Minimize request size – Serve scaled images – Optimize images
  • 10.
    Optimize Images • Reducethe file size of images • ImageOptim • Plugins – WP Smush It – Kraken.io • Helps: – Optimize images
  • 11.
    Optimize Content • Useembeds sparingly – They’re nice but can load slow • Be aware of what plugins add – More JS – More CSS • Helps: – Minimize request size – Defer parsing of Javascript
  • 12.
  • 13.
    Jetpack Photon • CDNfor images – Serves images from WordPress.com • Scales images it serves to the browser • Performs “blur up” method of loading • Helps: – Serve scaled images – Use a Content Delivery Network (CDN) – Optimize images
  • 14.
    Autoptimize • Minify andconcatenate CSS and JS • Works with scripts enqueued by plugins • Helps: – Minify HTML – Minify CSS – Minify JS – Minimize request size – Make fewer http requests
  • 15.
    a3 Lazy Load •Easily lazy load images and iframes below the fold • Helps: – Defer parsing of Javascript – Minimize request size – Reduce server response time – Prioritize visible content – Eliminate render-blocking Javascript and CSS in above-the-fold content

Editor's Notes

  • #7 SuperCacher Site Ground caching
  • #8 Gzip on winning wp
  • #10 Crop an image in Canva
  • #11 Upload an image with WP Smush It enabled
  • #14 Note trick about setting CDN url in GT Metrix
  • #15 Set it up
  • #16 Set it up. Show loading on youtube and soundcloud