optimising for performance

33
OPTIMISING FOR PERFORMANCE GETTING FULL SCORE ON GOOGLE PAGESPEED, PINGDOM AND GTMETRIX

Upload: thomasmb

Post on 05-Dec-2014

215 views

Category:

Technology


3 download

DESCRIPTION

Getting full score on Google PageSpeed, Pingdom and GTMetrix

TRANSCRIPT

Page 1: Optimising for Performance

O P T I M I S I N G F O R P E R F O R M A N C E

G E T T I N G F U L L S C O R E O N G O O G L E PA G E S P E E D , P I N G D O M A N D G T M E T R I X

Page 2: Optimising for Performance

T H O M A S B E N S M A N NL E A D D E V E L O P E R A N D S O L U T I O N S A R C H I T E C T M E T R O N E T A S - M E T R O N E T. N O

Page 3: Optimising for Performance

W H Y S P E E D M AT T E R S ?

• More returning visitors

• More page views

Page 4: Optimising for Performance

First impressions matter

Page 5: Optimising for Performance

W H Y S P E E D M AT T E R S ?

• More returning visitors

• More page views

• Google cares (SEO)

• When you know something could be better…

Page 6: Optimising for Performance

“Fast is better than slow.”

Page 7: Optimising for Performance

T E R M I N O L O G Y

S E R V E R T E C H

Page 8: Optimising for Performance

T E R M I N O L O G Y

• Nginx - known for speed and resource usage

• Varnish - used for caching and/or load balancing

• Apache - very common

• Google PageSpeed mod - Google’s module for Apache and Nginx

Page 9: Optimising for Performance

– A M A Z O N C T O , W E R N E R V O G E L S

“I’ve hugged a lot of servers in my life, and believe me, they do not hug you back. They hate you.”

Page 10: Optimising for Performance

C O M P R E S S I O NS A V I N G B A N D W I D T H

Page 11: Optimising for Performance

C O M P R E S S I O N

• Save bandwidth

• No difference in content

• Gzip

• mod-deflate (apache)

Page 12: Optimising for Performance

R E N D E R B L O C K I N GW H O D O E S N ’ T L I K E W A I T I N G I N L I N E ?

Page 13: Optimising for Performance

R E N D E R B L O C K I N G

• Scripts

• Styles

• The page has to wait

• Load CSS before JS

• Load JS in the footer

• Load JS async

Page 14: Optimising for Performance

M I N I F Y…K E E P I T S H O R T

Page 15: Optimising for Performance

M I N I F Y

• CSS, JS and HTML

• Reduced file sizes

• YUI Compressor

• Google PageSpeed mod for Apache and Nginx

Page 16: Optimising for Performance

O P T I M I S E I M A G E S

• ImageOptim (on your mac)

• Atomised with Grunt or Gulp

• Server-side optimisers (jpegtran, optipng/pngout)

• WordPress plugin (EWWW image optimizer)

• Google PageSpeed mod

Page 17: Optimising for Performance

G E T T I N G R E S O U R C E S W H E N N E E D E D I F N E E D E D

Lazy loading

P L U G I N : B J L A Z Y L O A D

Page 18: Optimising for Performance

R E D U C E R E Q U E S T SW H Y M A K E I T D I F F I C U LT F O R O U R S E L F ?

Page 19: Optimising for Performance

R E D U C E R E Q U E S T S

• Why keep asking the server?

• Combine files

• Inline small files

• Reduce request

P L U G I N : M I N I T B Y K A S PA R S D

Page 20: Optimising for Performance

Keep your content in stock

Page 21: Optimising for Performance

C A C H I N G P L U G I N S

• W3 Total Cache

• Batcache

• WP Super Cache

• Quick Cache

Page 22: Optimising for Performance

C A C H I N G E N G I N E S

• APC (PHP < 5.5)

• Memcache

• Redis

Page 23: Optimising for Performance

C A C H I N G S O L U T I O N S

• Varnish

• Nginx

• Cloudflare (external)

Page 24: Optimising for Performance

C L I E N T S I D E C A C H I N G

• Setting HTTP headers

• expires

• cache-control/pragma

• Version numbers in name

x script.js

x script.js?v=1.2

✓ script-1.2.js

Page 25: Optimising for Performance

M O D _ PA G E S P E E D

• Caches

• Combines and/or inlines files

• Minifies JS, CSS and HTML

• Optimizes images (metadata, compression, dimensions)

• Lazy loading images

Page 26: Optimising for Performance

W A R N I N GA F R I E N D LY

Page 27: Optimising for Performance

T E S T I N G A N D E VA L U AT I O N

• Google Pagespeed Insights

• Pingdom Website Speed Test

• GTMetrix

!

• Most importantly, the people who visit the site

Page 28: Optimising for Performance
Page 29: Optimising for Performance

R E S U LT SC H E C K I N G O U T

Page 30: Optimising for Performance

R E S U LT SC H E C K I N G O U T

Page 31: Optimising for Performance

R E S U LT SC H E C K I N G O U T

Page 32: Optimising for Performance

G O A L S

• Full score should not be a goal

• Use it as guidelines

• Don’t follow it blindly

• Know why

Page 33: Optimising for Performance

T H A N K Y O U F O R Y O U R T I M E – A N Y Q U E S T I O N S ?

T H A T ’ S A L L I H A D