Upload
aki-bjoerklund
View
214
Download
1
Embed Size (px)
Citation preview
© 1998 PhotoSpin
Average page is 1795 KBin size and growing
WordPress sites are worse
In Finland: WordPress sites average 2,5 MB
Page size matters
Page sizedoes not matter
(that much)
Page size≠
page performance
Page performance ≠
server-side performance
PRACTICAL TIPS
Optimize images
Optimize images for users automatically
Never use the original sizes of uploaded images
Prevent users usingthe full size image
There is a filter 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' );
Don’t load imagesa.k.a. lazy loading
Make browserscache resources
Minimize,combine, compress
Minimize,combine, compress
Minimize,combine, compress
Minimize,combine, compress
Advanced stuff
Move scripts to bottom
…with WP Simple Asset Optimizer
Moving scriptsadd_filter( 'wpsao_move', function () { return array( 'jquery_json', 'gform_placeholder', 'gform_gravityforms', 'optin-monster-api-script', 'wp-mediaelement', 'visualizer-google-jsapi', 'visualizer-render' ); } );
Inline CSS and JavaScript
Inliningadd_filter( 'wpsao_inline', function () { return array( 'modernizr', 'h1-stylesheet' => array( 'replace' => '../../', 'with' => get_template_directory_uri() . '/assets/' ) ); } );
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…
Thanks!
@akibjorklund
Go to akibjorklund.com/wcfi2015 to get all the links mentioned in this talk.