drupal front-end performance

37
Front-end performance.

Upload: adci-llc

Post on 26-Jun-2015

111 views

Category:

Technology


1 download

DESCRIPTION

Drupal front-end performance

TRANSCRIPT

Page 1: Drupal front-end performance

Front-end performance.

Page 2: Drupal front-end performance
Page 3: Drupal front-end performance

● 44 requests for anonymous user

● 60 requests for administrator

Page 4: Drupal front-end performance
Page 5: Drupal front-end performance
Page 6: Drupal front-end performance

● 28 requests for anonymous user

● 39 requests for administrator

Page 7: Drupal front-end performance

Why it’s important?

Page 8: Drupal front-end performance

● Better user experience

● Higher conversion rate

● SEO

Page 9: Drupal front-end performance

Numbers

Page 10: Drupal front-end performance

● 80-95% of performance happens in the front end

● Amazon: 100ms cost 1% of sales

● Yahoo: 400ms improvement ~9% traffic

● Firefox: 2.2s improvement ~15.4% downloads

Page 11: Drupal front-end performance

Tools

Page 13: Drupal front-end performance

● Use fewer HTTP requests● Use CDN● Avoid empty src or href● Add Expires header● Compress components with gzip● Put CSS at top● Put JS at bottom● Make JS and CSS external● Reduce DNS lookups

Page 14: Drupal front-end performance

● Minify JS and CSS● Avoid URL redirects● Remove duplicate CSS and JS● Configure ETags● Make AJAX cacheable● Use GET for AJAX requests● Reduce number of DOM elements● Avoid HTTP 404 error● Reduce cookie size

Page 15: Drupal front-end performance

● Use cookie-free domains● Avoid AlphaImageLoader filter● Do not scale images in HTML● Make favicon small and cacheable

Page 16: Drupal front-end performance

Advanced CSS/JS Aggregation

● gzip CSS/JS● Bundler: groups files together● CSS/JS compression● CSS/JS validation● JS to the footer● lot-lot more options

Page 17: Drupal front-end performance

Advanced CSS/JS Aggregation● 23.4KB vs 4.5KB gzipped CSS

(~80% decrease)● 93.9KB vs 32.3KB gzipped JS

(~65% decrease)● 23.4KB vs 4.4KB gzip + minify CSS

(~81% decrease)● 93.9KB vs 28.5KB gzip + minify JS

(~70% decrease)

Page 18: Drupal front-end performance

CSS

Page 21: Drupal front-end performance

Use CSS3!!!

Page 22: Drupal front-end performance

Do not do a lot to support legacy browsers!!!

Page 23: Drupal front-end performance

Remove unused CSS

WTF?

Page 24: Drupal front-end performance

Remove unused CSSOmega

Page 25: Drupal front-end performance

Remove unused CSSAdaptive Theme

Page 26: Drupal front-end performance

Remove unused CSSTao

function tao_css_alter(&$css) { $exclude = array( 'misc/vertical-tabs.css' => FALSE, 'modules/aggregator/aggregator.css' => FALSE, 'modules/block/block.css' => FALSE, 'modules/book/book.css' => FALSE, 'modules/comment/comment.css' => FALSE, //... 'modules/update/update.css' => FALSE, 'modules/user/user.css' => FALSE, ); $css = array_diff_key($css, $exclude);}

Page 27: Drupal front-end performance

Use CSS sprites

3.85KB

2.5KB

Page 29: Drupal front-end performance

jQuery Update

Default: 1.4.4 (2010.11.11)

jQuery Update: 1.7 site’s theme + 1.5 admin pages

Page 30: Drupal front-end performance

Images

Page 31: Drupal front-end performance

Do not set 100% quality

Page 32: Drupal front-end performance

100% qualityOriginal JPEG:

640x480px, 49.38KB

● No effects: 151KB

● Rotate 360°: 151KB

● Scale 2000px x 100%, no upscaling: 151KB

● Scale & Crop 480x360px: 139KB

Page 33: Drupal front-end performance

100% quality

● No effects: 151KB

● Rotate 360°: 151KB

● Scale 2000px x 100%, no upscaling: 151KB

● Scale & Crop 480x360px: 139KB

Original JPEG:640x480px, 49.38KB

Page 35: Drupal front-end performance

● Fences

● Views style settings

Markup

Page 37: Drupal front-end performance

Thank you