Hacker News new | ask | show | jobs
by Ruud-v-A 3355 days ago
> Today, we are rolling out Twitter Lite, a new mobile web experience which minimizes data usage, loads quickly on slower connections, is resilient on unreliable mobile networks, and takes up less than 1MB on your device.

1 MB is “acceptable” by today’s standards, but when you think about it — 1 MB to display a few 140-character tweets?

2 comments

Cmon, that's disingenuous. It does a lot more than just display a few text strings.

You've got routing, templates, event handlers, search, a lightbox, settings pages, the whole DM chat-style interface, the whole posting interface, and probably more that I'm not even thinking about.

Now I'm not saying that it couldn't be smaller - quite probably even substantially smaller. It'd be great to get it down to 100KB. I bet you could have a much smaller first load for just the feed, and then dynamically load in the JS for the other routes as they're requested. That could then be cached locally with service workers.

Edit: Looks like they do actually already do that. I just unregistered their Service Worker and refreshed - my load was ~300KB. Still kinda weighty but a lot less than 1MB.

From https://blog.twitter.com/2017/how-we-built-twitter-lite:

> the app streams the initial HTML response to the browser, sending instructions to preload critical resources while the server constructs the initial app state. Using webpack, the app’s scripts are broken up into granular pieces and loaded on demand. This means that the initial load only requires resources needed for the visible screen. (When available, a Service Worker will precache additional resources and allow instant future navigations to other screens.) These changes allow us to progressive load the app so people can sooner consume and create Tweets.

That's like saying basketball is equivalent to just throwing a ball through a hoop. You are oversimplifying it.