SET A
PERFORMANCE BUDGET
A BASELINE FOR PAGE SIZE AND
NUMBER OF REQUESTS
More Info:
http://timkadlec.com/2013/01/setting-a-performance-budget/
Slide 29
RESPONSIVE
IMAGES
npm install grunt-
responsive-images
npm install gulp-responsive
Serve images that fit the size of the users’ device appropriately.
Otherwise we’re just sending wasted pixels
Slide 30
Workflow
task
resizes
image
Use
srcset
and
picture
element
RESPONSIVE
IMAGES
More Info:
https://dev.opera.com/articles/responsive-images/
SRCSET
PICTURE
Resize
Yes
No
Pixel Density (e.g. Retina)
Yes
No
Art Direction Changing
No
Yes
MIME Type (e.g. WebP)
No
Yes
Slide 37
Source:
http://caniuse.com/
SRCSET
PICTURE
Slide 38
LACKING BROWSER SUPPORT?
https://github.com/scottjehl/picturefill
USE A POLYFILL!
Slide 39
COMPRESS
IMAGES
npm install grunt-contrib-imagemin
npm install gulp-imagemin
Compress images so they take less time to download
Slide 40
FILE SIZE SAVINGS
BEFORE
AFTER
273KB
240KB
Slide 41
UNUSED
CSS
npm install grunt-
uncss
npm install gulp-uncss
No need to include unused CSS on our pages.
MINIFY, UGLIFY & CONCATENATE
npm install grunt-
usemin
npm install gulp-usemin
Usemin
runs a number of performance helper tasks such as uglify,
cssmin and concat
enate automatically.
CONCLUSION
Design with a performance budget
Use a workflow to save you pain
Optimise your images, CSS and JavaScript
Educate the people who are going to be maintaining the site!
ALLOWS SERVERS TO
PUSH RESPONSES
TO CLIENT
E.G. SEND CSS BEFORE REQUESTED
Slide 76
WHEN CAN I
USE
HTTP/2
?
Slide 77
Source:
http://caniuse.com/#search=http2
Slide 78
HTTP/2
ADOPTION
•
Support from most major server software by end of 2015
•
nginx
alpha now available
•
Apache
2.4.12 supported via patching, in next release
•
IIS
for Windows 10