3 ms·
Facebook makes over 300 requests for me just loading the main logged in page while showing me exactly 1 timeline item. Hovering my mouse over that item makes an
by ndriscoll 3y ago
Facebook makes over 300 requests for me just loading the main logged in page while showing me exactly 1 timeline item. Hovering my mouse over that item makes another 100 requests or so. Scrolling down loads another item at the cost of over 100 requests again. It's impressive in a perverse way just how inefficient they can be while managing to make it still work, and somewhat disturbing that their ads bring in enough money to make them extremely profitable despite it.
- golergka 3y agoWasn't the whole point of GraphQL in mitigating this?
- serial_dev 3y agoYeah, that's why you have only 100 requests* when you hover over an item instead of 800. (* allegedly, didn't verify it myself)
- zer00eyz 3y agoNo. Here is the thing, hypermedia is cacheable. React/Graphql not so much. Facebook is now just an application that runs in the browser. As a poor, small developer who doesn't want to hemorrhage money, I tend to want things to be more hypermedia and less app. It saves on complexity and bandwidth and costs.
- yodsanklai 3y agoCould someone tell me what these hundreds of requests could do?
- Solvency 3y agoTrack you, probably with a thousand layers of redundancy, tech bloat, and decades of mold.
- ndriscoll 3y agoA lot of them appear to be that they've split their javascript into a gazillion files for whatever reason (I suppose because they have several MB of it). But someone or lots of people there did seem to get addicted to dynamic loading. Like I've got 100 or so friends, but my friends page loads them 8-16 at a time as I scroll. Just send all 100 and set the profile pictures to deferred fetch. It'd probably be smaller than the js they have to make it do "infinite" scroll. Similarly, after getting to the bottom of their "infinite" scroll, my friend feed (which is annoyingly hidden away) gives me... 15 items. Just send me all 15. It's like 1-2 kB worth of data. If you're going to end the scroll after a dozen items, why is it using infinite scroll?
- sd9 3y agoCould be so they can track what you're looking at on the back end
- akira2501 3y agoThis is the company that instead of ditching PHP created a full on PHP to C++ transpiler and then deployed their while site on that for a few years.
- theptip 3y agoFB still runs on Hack.
- NooneAtAll3 3y ago> deployed their while site ??
- callalex 3y agoDo you have an ad blocker stopping the requests and causing retries?
- ndriscoll 3y agoI do have ublock origin on everything of mine, so conceivably it's reacting to that somehow. I'm no longer at my computer to be able to look more closely at what it's doing.
- chatmasta 3y agoWhenever you're running this kind of eyeball test with DevTools, make sure the "Disable Cache" option is _not_ checked. And even then, make sure the requests you're counting were not served from your browser cache. It's possible that only the first page load sends hundreds of requests, and subsequent loads may still initiate those requests, but have their responses served from your browser cache (or your cache is disabled). I would check myself, but I haven't logged into Facebook in many years. :)