Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The 12MB Web Page: A tale of perfect PageSpeed ...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ben Smithett
May 09, 2016
Technology
1
340
The 12MB Web Page: A tale of perfect PageSpeed scores & developer happiness
Quick little talk I did at an Envato Code Party on May 9 2016.
Ben Smithett
May 09, 2016
Tweet
Share
More Decks by Ben Smithett
See All by Ben Smithett
Atomic CSS with Fela
bensmithett
0
130
Objects in Space: A practical guide to CSS display, position & z-index
bensmithett
0
55
The UI is an Application
bensmithett
0
1.2k
Hands on with the modern front end stack
bensmithett
0
1.2k
The New Front End Stack: A really really really high level introduction
bensmithett
1
530
Smarter Sass/Less Builds with Webpack (MelbJS Edition)
bensmithett
0
340
Smarter Sass builds with Webpack
bensmithett
1
240
Faking Real Time: Optimistic Updates & Eventual Consistency (Decompress 2015)
bensmithett
0
510
Other Decks in Technology
See All in Technology
Greatest Disaster Hits in Web Performance
guaca
0
230
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
220
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
190
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
150
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
640
What happened to RubyGems and what can we learn?
mikemcquaid
0
290
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
530
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
Bill One急成長の舞台裏 開発組織が直面した失敗と教訓
sansantech
PRO
2
370
Azure Durable Functions で作った NL2SQL Agent の精度向上に取り組んだ話/jat08
thara0402
0
180
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
240
Featured
See All Featured
Discover your Explorer Soul
emna__ayadi
2
1.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
The Invisible Side of Design
smashingmag
302
51k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Chasing Engaging Ingredients in Design
codingconduct
0
110
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Tell your own story through comics
letsgokoyo
1
810
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Transcript
The 12MB Web Page A tale of perfect PageSpeed scores
& developer happiness
None
None
None
A static HTML page + some photos Fast? Easy to
build? Free?
Fast?
https://eev.ee/blog/2016/03/06/maybe-we-could-tone-down-the-javascript/
http://idlewords.com/talks/website_obesity.htm
Web pages are pretty fast by default! They only get
slow when we add “clever” cruft
on the other hand…
Photos are biiiiiiiiiig!
The challenge: Can I make a blazing fast, image- heavy
web page without resorting to lots of hacks & workarounds
How fast can a simple HTML document be?
None
None
None
None
None
Speed Index: 1613 In the fastest ~10% of all websites
Optimisation #1 A truthful browser spinner
https://medium.com/@kellycatchpole/10-best-dog-breeds-for-your- family-22ea2cdde78d Browser says page has finished loading LIES!!!!
Don’t make the browser spinner lie. When the page says
it’s done loading, it’s really done!
Optimisation #2 Progressive JPEG
None
Optimisation #3 Responsive Images
Widescreen + Retina: 11.1MB Tablet + Retina: 9.8MB Phone +
Retina: 8.7MB Widescreen: 7.8MB Tablet: 6.5MB Phone: 1.7MB
Optimisation #4 Font Face Observer
None
https://github.com/bramstein/fontfaceobserver
None
Optimisation #5 <script async src=“…”>
Optimisation #6 Cache everything forever
None
Optimisation #7 Use a CDN
None
Notable absentees: • “Critical CSS” • Loading content asynchronously •
Anything very tricky or hacky at all…
Easy to build?
I couuuld hand-write the HTML & CSS for this, but
I want…
• A living styleguide! • Sass! • Hot reloading! •
Reusable components!
The tooling: • React (no client side!) • Webpack +
static-site-generator-webpack-plugin • Sass • CSS Modules
React is a better back-end templating language than your favourite
back-end templating language.
None
None
Free?
GitHub Pages + CloudFlare =
GitHub Pages has pretty crappy caching settings…
None
But if you stick CloudFlare in front of it…
Easy cache header setting!
Free SSL! (well, “flexible SSL”)
A static HTML page + some photos Fast Easy to
build Free ✅ ✅ ✅