Front-end optimization
Make it fast!
rj zaworski, versal inc. · @rjzaworski · github.com/rjz
Slide 2
Slide 2 text
Any questions?
Slide 3
Slide 3 text
The First Rule of Optimization
Don’t.
Slide 4
Slide 4 text
The Second Rule of Optimization
Optimize for dev time.
Slide 5
Slide 5 text
So why do we care?
★ 47% of consumers expect a web page to
load in 2 seconds or less.
★ 40% of people abandon a website that takes
more than 3 seconds to load.
(http://blog.kissmetrics.com/loading-time/)
Slide 6
Slide 6 text
It's even worse for mobile.
“73% of mobile internet users say that they’ve
encountered a website that was too slow to
load.”
(http://blog.kissmetrics.com/loading-time/)
Browser caching
★ static assets
★ declare paths
that require
access
★ provide a
Slide 52
Slide 52 text
Use a Content Delivery Network
★ located near the users
★ replicate automagically
★ == fast
Slide 53
Slide 53 text
Use a Content Delivery Network
Share common assets with everyone else
★ cdnjs.com
★ jsDelivr.com
★ Google Hosted Libraries
Slide 54
Slide 54 text
Use a Content Delivery Network
★ Failure happens
Slide 55
Slide 55 text
Use a Content Delivery Network
★ Failure happens
★ So keep a local fallback handy
Slide 56
Slide 56 text
Server-side caching
On the application server
★ Minimize disk I/O
★ Cache popular files in memory
Optimize for dev time!
Slide 57
Slide 57 text
Summing up
★ Bandwidth: how big is the pipe?
★ Volume: how much needs to be delivered?
★ Proximity: how far away are the ends?
Slide 58
Slide 58 text
Summing up
★ Bandwidth: avoid blocking behaviors
★ Volume: minimize request count and size
★ Proximity: use browser caching and a CDN
Slide 59
Slide 59 text
Summing up
★ Bandwidth: avoid blocking behaviors
★ Volume: minimize request count and size
★ Proximity: use browser caching and a CDN
★ Optimize for dev time!
Slide 60
Slide 60 text
Thank you!
rj zaworski, versal inc. · @rjzaworski · github.com/rjz