This website contacted 65 IPs in 7 countries across 35 domains to perform 314 HTTP transactions. [...] In total, 4 MB of data was transfered, which is 12 MB uncompressed. It took 2.753 seconds to load this page.
Compare this to the now-SSR cnn.io: https://urlscan.io/result/7d13efac-ffaa-4ac2-a091-8611e39b20... (59kB transfer)
Edit: Someone scanned the lite-version before they switched to SSR: https://urlscan.io/result/2a9690eb-3992-4712-a657-c3be959d51...
btoa("\ud83d\ude0b") -> Uncaught DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
(Edit: apparently HN doesn't either; changed to \u...)
For what? This is a non-interactive text-only website. It shouldn't need anything beside HTML and CSS.
I've got NoScript on, and now the pages load perfectly. I think I may return to being a CNN reader now. If only they could figure out how to monetise this.
So even this "plain text" site still transfers ~98 % bloat and just ~2 % content.
its more around 90% JS, 10% content
After the first page load (with scripts cached) its around 87% content (unfortunately they don't seem to be caching CSS)
The question was why a pure-text non-interactive website needs any javascript at all.
* Generate a HTML/DOM based on a template and data.
* Lets you efficiently update that DOM based on updates to the data and/or model (this is it's killer feature).
But if you're just going to do the first thing (generate a HTML/DOM), you don't need most of React's feature set, and you certainly don't need to push heavy JS onto the client.
For those cases, a much better approach (for both clients and SEO) is to just pre-render the DOM/HTML server-side and serve that without any need for any javascript client-side (which is what the similarly named module "Preact" does).
This site appears to load ~350 KB of JavaScript, which I think is a bit excessive for a "lite" text-only site. From the sourcemaps, I found a long list of libraries, including:
* react
* redux
* redux-thunk
* react-router
* axios
* base64-js (why not window.atob/btoa?)
* core-js
* fbjs
* react-hot-loader (should not be in a production build)
* ...a bunch of other smaller modules
There's only about 10 KB of non-library application code. Note that I ignore gzip when evaluating this sort of stuff, since that many bytes of code still need to be parsed, no matter how much it compresses.
For the person who made this site, I would replace React with Preact (or Inferno), which should remove most of the bloat. Server side rendering would also be nice for those who don't have JavaScript enabled and would also improve the loading time.
At least it's still better than cnn.com. http://www.webpagetest.org/result/170910_C8_e78305788a19b0fb...