of 32 /32

WordCamp Finland 2015, Page performance optimization

Embed Size (px)

Text of WordCamp Finland 2015, Page performance optimization

  1. 1. 1998 PhotoSpin
  2. 2. Average page is 1795 KB in size and growing
  3. 3. WordPress sites are worse
  4. 4. In Finland: WordPress sites average 2,5 MB
  5. 5. Page size matters
  6. 6. Page size does not matter (that much)
  7. 7. Page size page performance
  8. 8. Page performance server-side performance
  9. 9. PRACTICAL TIPS
  10. 10. Optimize images
  11. 11. Optimize images for users automatically
  12. 12. Never use the original sizes of uploaded images
  13. 13. Prevent users using the full size image
  14. 14. There is a lter for that function h1_remove_full_image_size( $sizes ) { unset( $sizes['full'] ); return $sizes; } add_filter( 'image_size_names_choose', 'h1_remove_full_image_size' );
  15. 15. Dont load images a.k.a. lazy loading
  16. 16. Make browsers cache resources
  17. 17. Minimize, combine, compress
  18. 18. Minimize, combine, compress
  19. 19. Minimize, combine, compress
  20. 20. Minimize, combine, compress
  21. 21. Advanced stuff
  22. 22. Move scripts to bottom
  23. 23. with WP Simple Asset Optimizer
  24. 24. Moving scripts add_filter( 'wpsao_move', function () { return array( 'jquery_json', 'gform_placeholder', 'gform_gravityforms', 'optin-monster-api-script', 'wp-mediaelement', 'visualizer-google-jsapi', 'visualizer-render' ); } );
  25. 25. Inline CSS and JavaScript
  26. 26. Inlining add_filter( 'wpsao_inline', function () { return array( 'modernizr', 'h1-stylesheet' => array( 'replace' => '../../', 'with' => get_template_directory_uri() . '/assets/' ) ); } );
  27. 27. Topics skipped: CDNs, responsive and retina images, continuous performance measurement, inlining images, CSS sprites, server side optimization, prioritizing visible content, avoiding redirects, DNS, asynchronous JavaScript, HTTP2
  28. 28. Thanks! @akibjorklund Go to akibjorklund.com/wc2015 to get all the links mentioned in this talk.