Facebook’s News Feed has become increasingly feature rich over time, allowing users to interact with their friends’ stories in new and interesting ways. The introduction of the Like feature, launched in February, has been a huge success with an average of 0.3 Likes per user on the average day. The comment and Like box appearing below most feed stories is known as the “Universal Feedback Interface,” or UFI to Facebook engineers, and is an important aspect of communication among Facebook users. These new methods of communication do come at a cost, though.
In July, Lior Abraham, an engineer on the Feed team, presented the results of a study he had done on the markup size of the home page. He discovered that 34% of the markup on the home page was due to the UFI. Since the UFI appears on nearly every page on the site, reducing the markup on this feature would lead to page size wins across the board. In particular, the Like feature was selected as an aspect of the UFI that could be slimmed down.
While seemingly a minor change, the savings from this proved to be quite substantial. A UFI with no likes or comments used to be 1.7 kilobytes, despite not even being displayed on the page unless the user clicked Like. This change reduced the size of that empty UFI to under 100 bytes. A UFI with just a like sentence was also around 1.7 kilobytes which was reduced to around 900 bytes with this change. In early August, around three weeks after the presentation on markup size, the updated Like markup was pushed to the live web servers. At that time, the average size of home.php was around 250 kilobytes. This change decreased the average size of that page by 20 kilobytes. Without reducing the user experience, the homepage of Facebook had become around 8% slimmer. Finding small changes like this to make the site faster is one way that we can help improve Facebook for our users.
Dan Schafer, a summer engineering intern, just started his senior year at Carnegie Mellon University, and hopes this page loaded just a little bit faster for everyone.