

A single tweet page is 2.0 MB - skimbrel
http://mike.teczno.com/notes/bandwidth.html

======
mfringel
Several people in this thread state "It's cached, so why does it matter?"

So, even ignoring the issue with cold caches, how about the two megabytes of
code that the browser may need to go through to render the page?

What on earth is twitter doing on a given page that needs two megabytes of
code?*

* As of March 2012, for I'm sure this will look silly when there are 2 gigabyte pages, 20 years from now.

~~~
badusername
I don't think we'll have 2 gigabyte codebases..

~~~
kondro
Higher resolution displays, bump/texture maps for live 3D rendering, 8K video,
etc could all contribute to huge page sizes.

------
poutine
His rant doesn't seem too informed: "aggressive anti-performance and apparent
contempt for the web by Twitter’s designers"

According to his charts most of Twitter's page is JS/CSS and presumably set to
heavily cache. Very little is data. Once you've done the first page load
Twitter's pages will load quite fast and efficiently. While quite a lot of JS,
this is good design, not bad.

~~~
underwater
Yahoo did a study a while back and found that ~50% of their visitors had a
cold cache [http://yuiblog.com/blog/2007/01/04/performance-research-
part...](http://yuiblog.com/blog/2007/01/04/performance-research-part-2/)

~~~
newman314
Plus if you access Twitter over SSL, there might not be caching resulting in
heavy loads repeatedly.

~~~
ceejayoz
I'd imagine Twitter's serving `Cache-Control: public` where appropriate.

~~~
newman314
You would think but sadly, no.

They serve the actual tweet as "Cache-Control: no-cache, no-store, must-
revalidate, pre-check=0, post-check=0"

<https://pastee.org/bzeb5>

EDIT: Just to check, I also looked at one of their css resources.
[https://si0.twimg.com/a/1330626450/t1/css/t1_core_logged_out...](https://si0.twimg.com/a/1330626450/t1/css/t1_core_logged_out.bundle.css)

Cache-Control: private, max-age=31449600

So I'm not confident Twitter actually understands how to set things.

PS: Hey Twitter, I can help =)

~~~
eonwe
Maybe it's just that they don't want that one page cached as they may update
their scripts, images and stylesheets. And for that css-file, I think that
whenever they change the css, they'll just give the resource a new address so
cache is only invalidated when there are actual changes.

~~~
newman314
That does not make sense. If they update that page, then it'll get refreshed
when it expires.

For the CSS file, some browsers are buggy so it really should be set to
"Cache-Control: public".

See [http://www.acunote.com/blog/2008/07/why-you-should-use-
cache...](http://www.acunote.com/blog/2008/07/why-you-should-use-cache-
control-pupblic-for-caching-to-work-with-ssl.html)

------
rowanseymour
I live in Rwanda and like a sizeable portion of Twitter's userbase, have very
slow internet. When Twitter switched to their new design it got a lot harder
to open their site... I kept using the old version until they removed it. I
don't understand why - it's not pulling down a lot of data, it's not even
making that many requests (~50), but this site and other AJAX rich sites just
don't seem to work as well as the old less-AJAXy versions on a really slow
internet connection with a bit of packet loss

~~~
klous
if you want a more lightweight version of twitter on any browser, try:
<http://mobile.twitter.com>

~~~
technomancy
You can also play user-agent games to get the Android version in your browser.
I prefer the regular mobile edition, but it's interesting to poke around; I've
found three separate versions of the site just by faking out my user agent.

------
johncoltrane
All of the comments here could be shortened to "It's cached so it doesn't
matter" as if the main problem was "2 MB is too large hence loading is too
slow".

But the problem here (according to the author and I tend to agree with him) is
that one needs to load too much junk for too little actual content; whether
the junk in question is cached or not.

Now, ideally, a tweet's 140 characters shouldn't weight 2 MB but Twitter users
need tools to act upon those tweets: re-tweet, follow a link, etc. and those
tools come with a cost.

A relatively high cost but one we can afford, with the help of caching.

~~~
Isofarro
A retweet is just a post request. A follow this person is a post request.
Those can both be done with a simple HTML form.

~~~
woodall
If you give the browser a form, it's going to want a callback(JS); to make
sure everything went through. When you give it the callback, it'll probably
ask you for a image; pretty UIs are important. When you give a browser an
image, it'll need to be styled(CSS). . . and so begins the theory of "If you
give a browser a cookie".

Granted 2MB is pretty big, but the only people I see complaining are techies;
valid complaints but do not effect Twitter's bottom line.

------
untog
File this under "annoying to developers and no-one else".

Twitter obviously caches 99% of this stuff. I absolutely agree that 2.2MB on
one page seems absolutely insane, but that doesn't match up with the
experience every time you load the page. And I imagine it's pre-caching code
that runs on other pages as well, so you most likely only ever take that
download hit once.

Yes, they should bring that amount down. No, it probably isn't going to be a
priority.

~~~
ChrisLTD
Shouldn't it be a higher priority? More and more web users are accessing sites
from low powered devices with slow connections that might even have data caps
(think tablets or netbooks on 3G networks).

Twitter pages don't even seem particularly complex functionally or
graphically, so why should the payload be so large?

~~~
untog
More and more users are on mobile devices, sure. But those load up the mobile
version of the Twitter site, which is very lean.

~~~
woobar
Not when they are clicking on a link in email or other page.

EDIT: misread your comment. Thought you were talking about mobile apps.

Also, I would not call their mobile site 'very lean'. Just got a single twit
page on iPhone: 817Kb.

~~~
untog
Really? Because when I go to a Twitter link on my phone it redirects me to the
mobile site, irrespective of the original domain.

~~~
woobar
I was wrong, see update.

------
keeperofdakeys
It takes 3-5 seconds for my rather powerful laptop to 'build' a twitter page
after it has loaded (since it is doing AJAX etc), and this is warm. This is
also on a rather fast internet connection, in the latest firefox and chrome.
Compare this to Facebook - which has enough javascript to make it slow on my
netbook - it loads almost instantaneously under the same circumstances, even
when performing AJAX requests.

------
hpaavola
One tweet is 2 MB? More like 670 KB for first load and 18 KB cached.
<http://imgur.com/QFIjU>

~~~
jarek
Sign in and see what happens.

~~~
hpaavola
Nothing happened. Page size stayed roughly the same.

------
zacman85
Does anyone know how to get those graphs to show up in the current version of
WebKit? They seem to have disappeared or are hidden.

~~~
ralfd
This is a good question. The resource panel from the old Safari 4 webinspector
looked that way:

<http://www.webkit.org/blog/197/web-inspector-redesign/>

~~~
jason_slack
Yup, Safari 5 I dont see this.

~~~
nerdtalker
The closest thing is now the bottom row under Network, which shows total
requests and network transfer for the current page load.

------
noonespecial
The first tweet is 2 MB. How much is the second?

------
tripzilch
Try <http://m.twitter.com> , it's the dressed-down mobile version of Twitter.

It doesn't have all the features, but easily makes up for that by the fact
that you can actually _click around_ as much as you like without your browser
getting all slumpy from loading huge pages or doing javascript.

You'd expect caching to help, but there's a lot of truth in the _jQuery tax_
article[1]: even if you got the code cached, executing it all takes a
significant amount of time, and the sluggishness is made worse by the fact
that during this time your CPU is busy, unlike with data transfers which at
most cost some memory.

I don't use the m.twitter.com site all the time, but I switch often enough
whenever I get too annoyed by default Twitter's slowness.

The only real downside (for me) is that you can't click through to a full
resolution version of a profile picture. Otherwise all the basic features are
in there.

[1] [http://samsaffron.com/archive/2012/02/17/stop-paying-your-
jq...](http://samsaffron.com/archive/2012/02/17/stop-paying-your-jquery-tax)

------
tzury
Well, I measured that with chrome and it wasn't 2MB rather ~450 KB.

Talking about 140 chars is irrelevant, a tweet, is a 140 (unicode) chars
handler for a (mini social) graph, and this is how we should look at it.

In that particular page he's talking about[1] there are 10 profiles info
(status owner + 9 retweeters) embedded within the page so when you click on a
profile thumbnail you get the profile modal with some basic info and "Follow"
button etc.

381Kb out of those 450 belongs to his own background image [2].

In other words, twitter does a very good job at making their service fast and
speedy.

1\. <https://twitter.com/#!/bos31337/status/172156922491969536>

2\.
[https://twimg0-a.akamaihd.net/profile_background_images/9706...](https://twimg0-a.akamaihd.net/profile_background_images/97067350/backy.jpg)

------
tpurves
How does this work, is he reporting compressed or uncompressed sizes of data?
text/css/js compresses really well for transmission, images do not.

User-defined image backgrounds can also be up to 800k-ish for twitter too
right?

------
OneBytePerGreen
Funny: Every user comment on reddit has about 3.4 KB of HTML overhead (<div>,
in-line javascript, etc), including multiple <!--IE6sux--> comments.

It really adds up for a large thread.

------
webwanderings
No wonder it takes long for Twitter pages to load. Such things show up only
when you're on slower speeds.

~~~
erikabele
Exactly - just set your phone to EDGE and pull up a tweet page in your mobile
browser and you'll see how long it takes. And not only for the 1st page load
but for all others too. I can pull up a Facebook page (while being logged in)
and have that served to me in a fraction of the time it takes for Twitter.
Compare that to the feature-set and your opinion will change quickly. Just try
it, no stats & graphs needed, you'll see...

~~~
DanI-S
Honestly, Facebook's load time is quite phenomenal. It is one of the most
feature-laden and complex consumer web applications out there and they still
manage to set the bar with regards to speed and multi-platform usability.

~~~
ghein
Sadly Facebook's tools for other sites are some of the slowest things on the
web. That they're attached to every post and so can be called 10+ times per
page really doesn't help.

Scrolling on TechCrunch with your mouse over the post area is a hilariously
pitiful experience.

~~~
newman314
Actually, since I blocked all Facebook widgets (tracking or otherwise), it has
the nice side effect of not loading the comments when I accidentally land on a
TechCrunch article.

Makes the site load faster =)

------
swang
Can anyone tell which page he loaded specifically? I just loaded the latest
status update on my timeline in incognito mode and all it downloaded was
~578kb+ of data.

------
mrcalzone
This might be one of the best reasons to have native (mobile) clients. As a
web-developer I like the model of writing one web-application to fit all
clients, and being able to link to pages etc. But on a slow connection it
certainly makes sense not to have to download the GUI before viewing the
content. As the author points out, the content from the API is just some
hundred bytes.

------
neilmiddleton
Ah, but how big is the (downloaded) size of the next page on each of those
sites?

------
AdamTReineke
Maybe so, but how much of that 1.65MB of Javascript is cached by the browser?

~~~
pyre
If the initial load-up time is slow, then you're probably less likely to click
that Twitter link knowing that the initial page-load is always slow.

The warm-cache situation only matters to people that are on Twitter all the
time, so this possibly has the effect of keeping existing users happy while
raising a barrier to new users (or pushing infrequent users to completely
abandon the system).

Secondly, you're only looking at download size (the importance of is really to
imply a certain amount of time it takes to download those resources). Since
Twitter's JS platform is about doing all of the HTML rendering on the client-
side that has to be taken into account (this wasn't a concern in the past when
it was mostly done on the server-side). If the page takes 3s ~ 5s to load even
with a warm cache and a tiny (size) ajax-request, then it sort of defeats the
purpose (unless your purpose is to relieve server-load instead of in-browser
load times).

------
ahoyhere
In Q1 2007, my husband and I were invited to Twitter HQ for a meeting -- I was
pitching a visualization project, my husband (renowned JS developer Thomas
Fuchs) was proposing that we fix their horrible front-end performance issues
(both page load & laggy JS code). We met with ev, some of the team, and the
new CTO at the time. They nodded and agreed it was important. It would only
take about 2 days of consulting. They later said "We can't get it together to
hire you." Not due to the money (only a few grand, really), but about what you
might call "political will."

Their front-end performance situation has sadly never gotten better… and has
definitely gotten worse.

We started to build the visualization project anyway, and it got us a little
bit of fame and a lot of consulting work: <http://twistori.com>

And just under a year later, we published a book on front-end performance:
<http://jsrocks.com>

But I still wish we could have fixed their damn front end. Every time somebody
tweets a link to a tweet and it opens up as a web page on my iPhone and I have
to watch a blank screen for 10 freaking seconds before the tweet actually
shows up, I die a little inside.

This story amuses & horrifies people who believe that startups are more
flexible, responsive, & sane than big companies. At this time, Twitter the
company was definitely smaller than 30 people… around 15 if memory serves, but
I'm not sure. It was definitely small, either way. Meanwhile Twitter the site
was growing in popularity by leaps & bounds every second. I'm sure the
bandwidth saved alone would have paid back our consulting fees in a matter of
a few weeks, or less.

~~~
loceng
Without knowing the internal details it sounds like there's some fear locking
out change-making decisions.

------
rajpaul
I tried to use the twitter mobile site. I'll never do it again because it
takes too long to load.

This is why people use the twitter app instead of the site.

------
funkah
Simplistic.

------
shimon_e
The web will be a better place once everyone has 100mbps and servers have
10gbps. Sites like the verge can load in one second without caching.

~~~
robin_reala
Wirth’s Law: _Software is getting slower more rapidly than hardware becomes
faster._

~~~
shimon_e
Web data usage != slow software

~~~
underwater
But the amount of data will also increase relative to available bandwidth. A
few years ago a 2MB page would have been unthinkable. Maybe in five years
we'll be seeing 10MB of resources delivered for a page load.

~~~
shimon_e
Which at 100mbps will take about 1 second.

~~~
underwater
True, but we're not going to instantly switch everyone on the planet to those
speeds.

My parents have only upgraded to "high speed" 512kbs in the last few years. My
80 year of Grandfather is still on dial up. I don't think expecting him to
wait 5 minutes to load a Tweet is reasonable.

