39

Kansas City WordCamp - Website Performance

Embed Size (px)

Citation preview

Page 1: Kansas City WordCamp - Website Performance
Page 2: Kansas City WordCamp - Website Performance

What the hell is this?

• what is performance and who cares?• what’s dragging you down?• is WordPress slow?• what can I do on the front end?

• what are some plugins I can install that will make my life easier without having to really pay attention to you?

Page 3: Kansas City WordCamp - Website Performance

QUESTIONS?

Page 4: Kansas City WordCamp - Website Performance

Performance = Perceived Speed

V

Page 5: Kansas City WordCamp - Website Performance

The Two Sides of the Website Coin

back end front end(server side) (client side)

Page 6: Kansas City WordCamp - Website Performance

The Weight of the Front End

20%80%

Page 7: Kansas City WordCamp - Website Performance

WHO CARES?

Page 8: Kansas City WordCamp - Website Performance
Page 9: Kansas City WordCamp - Website Performance
Page 10: Kansas City WordCamp - Website Performance
Page 11: Kansas City WordCamp - Website Performance
Page 12: Kansas City WordCamp - Website Performance

The Landscape by 2015

Quadruple Traffic Globally

Devices:Desktop: 25%Laptop: 83%Smartphone: 194%EB Reader: 550%Tablet: 750%

Page 13: Kansas City WordCamp - Website Performance

WHAT’S DRAGGING YOU DOWN?

Page 14: Kansas City WordCamp - Website Performance

• network reliability• file sizes• HTTP requests• server configuration• WordPress itself

Balls, Chains, Anchors, Speed Bumps

Page 15: Kansas City WordCamp - Website Performance

Network Factors

• space between mobile towers

• visitor’s data plan• quality of

connection• random acts

of God• a billion

other things

Page 16: Kansas City WordCamp - Website Performance

File Size

Page 17: Kansas City WordCamp - Website Performance

HTTP Requests

Page 18: Kansas City WordCamp - Website Performance

Server Configuration

Page 19: Kansas City WordCamp - Website Performance

Balls, Chains, Anchors, Speed Bumps

• network reliability• file sizes• HTTP requests• server configuration• WordPress itself

Page 20: Kansas City WordCamp - Website Performance

IS WORDPRESS SLOW?

Page 21: Kansas City WordCamp - Website Performance

IT’S ONLY AS FAST AS YOUR THEME.

Page 22: Kansas City WordCamp - Website Performance

• 0 JS files(0k)

• 1 CSS files(23k)

• 2 images(53k)

• 0 iframes(0k)

80k+ download~5 requests

Page 23: Kansas City WordCamp - Website Performance

• 11 JS files(191k)

• 3 CSS files(43k)

• 6 images(179k)

• 2 iframes(16k)

500k+ download20+ requests

Page 24: Kansas City WordCamp - Website Performance

• 23 JS files(1243k)

• 6 CSS files(92k)

• 70 images(549k)

• 3 iframes(123k)

2000k+ download100+ requests

Page 25: Kansas City WordCamp - Website Performance

WHAT CAN I DO ON THE FRONT END?

Page 26: Kansas City WordCamp - Website Performance

HTML

• HTML5 is your friend• more semantic tag use, less

div soup; default WP does NOT do this

• avoid the hidden calories of iframes

• strip white space

Page 27: Kansas City WordCamp - Website Performance

CSS

• kill unnecessary rules• shorthand• combine• minify

Page 28: Kansas City WordCamp - Website Performance

JavaScript

• if you load a library, load it from Google APIs(75% less load impact)

• native JS is faster(select element by ID through jQuery = 86% slower than native)

• combine• minify• load at the bottom

Page 29: Kansas City WordCamp - Website Performance

Images

• CSS3 is your friend• image sprites• CRUSH THEM

Page 30: Kansas City WordCamp - Website Performance

How CSS is More Efficient

• Traditional:2 imagesExtra markup~ 5-6k, extra requests

div {height: 300px;width: 300px;border: 2px solid #0c9da9;box-shadow: 0 5px 10px rgba(0,0,0,.4),inset 0 0 0 2px rgba(255,255,255,.7);border-radius: 10px;background: #daf0ff;background: -moz-linear-gradient(top, #daf0ff 0%, #99cfff 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#daf0ff), color-stop(100%,#99cfff));background: -webkit-linear-gradient(top, #daf0ff 0%,#99cfff 100%);background: -o-linear-gradient(top, #daf0ff 0%,#99cfff 100%);background: -ms-linear-gradient(top, #daf0ff 0%,#99cfff 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#daf0ff', endColorstr='#99cfff',GradientType=0 );background: linear-gradient(top, #daf0ff 0%,#99cfff 100%);}

• CSS:No imagesNo extra markup740 bytes, no requests

Page 31: Kansas City WordCamp - Website Performance

Image Sprites

• Individually:20 images = 17k20 requests• Sprite:1 image = 4.2k1 request

Page 32: Kansas City WordCamp - Website Performance

Bonus Round

• content delivery network (CDN)• use your own subdomain (crap.acme.com)• gzip compression• more: HTML5 boilerplate

Page 33: Kansas City WordCamp - Website Performance

WHAT PLUGINS AREWORTH A SHIT?

Page 34: Kansas City WordCamp - Website Performance

There Are a Few

• WP Smush.it(automatic image compression)

• W3 Total Cache(complete server optimization, requires access to .htaccess)

• WP Minify(automatically minify JS and CSS)

• WP-HTML-Compression(strip white space from HTML)

• CDN Tools(helps set up a CDN i.e. Google API or MaxCDN)

Page 35: Kansas City WordCamp - Website Performance

HOW CAN I TEST?

Page 36: Kansas City WordCamp - Website Performance

GREAT QUESTION.

Page 37: Kansas City WordCamp - Website Performance

It’s Easy. Really.

• Plugin: Debug Queries(discover where your site is slowing down)

• Websites and Tools:– Pingdom Tools– Web Page Analyzer– Google Page Speed– Yahoo! YSlow (firefox plugin for Firebug)– Yahoo! Boomerang– Jdrop (mobile performance testing)

Page 38: Kansas City WordCamp - Website Performance

THANK YOU.REALLY.

Page 39: Kansas City WordCamp - Website Performance

@KEVINPOTTSgraphicpush.com/wp-performance