Jull Weber
jull@monkeykodeagency.comStages
If you are pushing 2.4MB x 1 x 1000 = 2.4GB
If you are pushing 2.4MB x 4 x 1000 = 9.6GB
Currently ~79.42% browser support
How do we do this?
@import 'CSS/header';
@import 'CSS/menu';
@import 'CSS/frontpage';
@import 'CSS/promo';
@import 'CSS/stories';
@import 'CSS/footer';
@import 'CSS/flexslider';
Becomes this:
…
…
…
…
Pretty much async all javascript unless you need control of execution
In .htaccess. Experiment with settings. 1 month? up to you.
# Cache all the things:
# One year for most static assets
Header set Cache-Control "max-age=31536000, public"
# One month for images
Header set Cache-Control "max-age=2628000, public"
Added header rel=preload
Example with PHP
header('Link: ' . $uri . '; rel=preload; as=' . $as, false);
}
$assets = array(
'/fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,700,700i,900,900i>' => 'style',
'' => 'style',
'/CSS/header.css' => 'style',
'/ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js>' => 'script',
'' => 'script',
''=> 'image'
);
array_walk( $assets, push_to_browser);