As soon as I deployed my code, the lead dev launched webpagetest.com and entered our domain name. The code was working perfectly, but he needed to make sure that the website was still fast. A perfect score of A or we would have to get back to work. Granted the company was in the process of being sold for 1.1 billion dollars.
This was in 2013. Speed was a common theme of frontend development. Every time we wrote code we tested on all the browsers we could get our hands on. And when the mobile web became a thing, we also started testing on several phones. At work, it was a business requirement to make our page snappy on the cheapest of phones. On the web, all JS tutorials were prefaced with speed. You would get laughed out of the room if you delivered a 1MB js file.
Speed was not a nice to have; it was a must-have. And Google favored faster websites, content was king and we obliged.
Fast forward to 2023, and you'll come across a surprising sight - a favicon that nearly hits the one-megabyte mark. It prompts us to question the essence of speed in today's web landscape. React, the prevailing JavaScript framework, now defaults to several megabytes in download size. Even when we employ lazy loading, images can still consume a significant chunk of your mobile data plan. The web has unmistakably evolved into a media content-centric platform, and there appears to be no turning back.
So what about small files? How did we go from obsessively optimizing for performance to seemingly neglecting it altogether? Is file size and speed something we still need to worry about?
Something has changed on the web, and it may be for the best. The web has shifted from primarily consumed on a desktop, to mostly mobile devices. And the shift on mobile devices cannot be ignored.
Cheap phones are getting good. And good phones are getting cheap — MKBHD
In 2018, DHH posted a benchmark showing the iPhone XS beating a 3 Ghz iMac Pro in JavaScript performance. A mobile device beat a desktop computer. It was safe to say that you can expect your smartphone to not choke on not highly optimized code.
Despite the remarkable power of modern devices, the web's responsiveness leaves much to be desired. We've made significant strides in speed and performance. But we've forsaken vital lessons from our digital past. HTML used to come with inherent optimizations, but today's new developers are pushed directly into the world of React. They never get a chance to delve into the web's fundamental principles. Tricks that were once the domain of HTML and CSS have now migrated entirely to JavaScript. Astonishingly, even the most potent tool that underpinned the internet's success – the hyperlink – is now being reconstructed solely in JavaScript, employing button tags and onclick events. Developers who've never had to optimize images are now at the mercy of users who casually upload 12MB images from their phones without resizing them for web use.
However, the web doesn't feel noticeably sluggish either. While we've certainly gained in computing power, we continue to inundate the digital highways with even larger volumes of data..
Coming from the old web, I still try to make my files as small as possible. I still test my webpages on Webpagetest. I still optimize my images to make them small and high quality at the same time. A powerful device that is not pushed to the limit can do so much more. We still need to care about performance, and I hope there won't be a day where you need to download over 1MB to read a post here.
Comments
There are no comments added yet.
Let's hear your thoughts