battling google pagespeed insights

19
BATTLING GOOGLE PAGESPEED INSIGHTS Jason Yingling | Red8 Interactive | @jason_yingling | jasonyingling.me

Upload: jason-yingling

Post on 22-Mar-2017

75 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Battling Google PageSpeed Insights

BATTLING GOOGLE PAGESPEED INSIGHTSJason Yingling | Red8 Interactive | @jason_yingling | jasonyingling.me

Page 2: Battling Google PageSpeed Insights

2

Happy Users Happy Google

Why Site Speed Matters

Page 3: Battling Google PageSpeed Insights

HUGE images Too many scripts Too many custom fonts Bad plugins or themes

Common Causes of Slow Sites

Page 4: Battling Google PageSpeed Insights

Tools For Measuring Site Speed

Google PageSpeed Insights GTMetrix

Page 5: Battling Google PageSpeed Insights

5

Chrome - Right Click - Select “Inspect” - Select “Network” tab

Safari - Safari > Preferences > Advanced - Check “Show Develop menu in

menu bar” - Right Click - Select “Inspect” - Select “Network” tab

Inspector

Page 6: Battling Google PageSpeed Insights

PageSpeed Insights measures how the page can improve its performance on: - time to above-the-fold load: Elapsed time from the moment a user requests a new page and to the moment the above-the-fold content is rendered by the browser. - time to full page load: Elapsed time from the moment a user requests a new page to the moment the page is fully rendered by the browser.

Google PageSpeed Insightshttps://developers.google.com/speed/pagespeed/insights/

Page 7: Battling Google PageSpeed Insights

JavaScript and CSS resources that need to be loaded before a web page can be rendered

Eliminate Render Blocking Scripts

Page 8: Battling Google PageSpeed Insights

8

Concatenate too. Plugin: Autoptimize

Minify All of the Things!

Page 9: Battling Google PageSpeed Insights

So you’re getting a JavaScript error. Exclude scripts from concatenation

Oh no! Something Broke!

Page 10: Battling Google PageSpeed Insights

10

Load what appears above the fold first

Prioritize Visible Content

Page 11: Battling Google PageSpeed Insights

Load below the fold content later Works for images, embeds, and iframe Plugin: BJ Lazy Load

Lazy Load Below the Fold

Page 12: Battling Google PageSpeed Insights

12

CSS Needed to load initial view of the site How to get it - Go to https://gist.github.com/

PaulKinlan/6284142  - Copy the script to your clipboard - Navigate to your page - Open the Console tab in the

Inspector - Paste the code and press enter - Copy the results

Critical CSS

Page 13: Battling Google PageSpeed Insights

Remove extra data from images and compress quality Plugin: Imagify (25mb/month) Fully Free: ImageOptim, FileOptimizer (Windows)

Optimize Images

Page 14: Battling Google PageSpeed Insights

14

Store and serve static files to visitors Hosting: WordPress hosts may have their own options Plugins: WP Super Cache

Leverage Browser Caching

Page 15: Battling Google PageSpeed Insights

Add custom expire headers to your .htaccess file Be careful in there Gist: https://gist.github.com/yingles/

3bc3c111137c47a2981e3e405a4ce577

Custom Expire Headers

Page 16: Battling Google PageSpeed Insights

16

- Upgrade your PHP - Upgrade your hosting - Determine the cause

with Query Monitor

Reduce Server Response Time

Page 17: Battling Google PageSpeed Insights

- Enable GZIP Compression in the .htaccess - Gist: https://gist.github.com/

yingles/3d61caa4910e8919b948be7b5abf5a50

- Avoid landing page redirects

A Few For The Road

Page 18: Battling Google PageSpeed Insights

18

- jasonyingling.me/pagespeed-resources

Questions & Resources

Page 19: Battling Google PageSpeed Insights