I was just perusing Addy Osmani's Ask Me Anything from this summer. While the post is full of wisdom, this comment stands out as web dev gold:
The first performance improvement that I check for is whether the site can be shipping less JavaScript while still providing most of their value to the end user. If you're sending down multiple megabytes of JS, that might be completely fine if your target audience are primarily on desktop, but if they're on mobile this can often dwarf the costs of other resources because it can take longer to process.
In general, I try to go through the following list and check off if the site could be doing better on one or more of them:
βοΈ Send less JavaScript (code-splitting)
π΄ Lazy-load non-critical resources
π Compress diligently! (GZip, Brotli)
π¦ Cache effectively (HTTP, Service Workers)
β‘οΈ Minify & optimize everything
πΌ Preresolve DNS for critical origins
π¨ Preload critical resources
π² Respect data plans
π Stream HTML responses
π‘ Make fewer HTTP requests
π° Have a Web Font loading strategy
π£ Route-based chunking
π Library sharding
π± PRPL pattern
π΄ Tree-shaking (Webpack, RollUp)
π½ Serve modern browsers ES2015 (babel-preset-env)
ποΈββοΈ Scope hoisting (Webpack)
π§ Donβt ship DEV code to PROD
Web performance is critical for user experience. Prioritize it before it becomes a problem.
Happy coding β€οΈ
Top comments (9)
Some additional things to not do...
"* Don't use video backgrounds"
Pretty please with sugar on top! Video breakthroughs may sound like a good idea, but in reality you're just learning how someone likes solve one specific problem. You're not really learning programming, or something even more important: problem solving.
But I love video backgrounds! That got me started with dev lol as I started off as a video artist. But yeah I agree the compression never usually does the quality justice and it is usually more trouble loading than fun
Have you met clients?
So true β whatdoesmysitecost.com/ is a great resource to make you feel guilty about this one :)
My absolute #1 that everyone always seems to miss room these lists: minimise DOM complexity. This is the single most performance thing that users will notice once the content loads client side. The simpler the DOM, the quicker CSS rules can be applied and JavaScript selectors can search for the right nodes. Fast initial load times are worthless, if the site kills the CPU when trying to make any changes at all to the dynamic content.
A lot of these items could be addressed with minimal effort and complexity via server side rendering.
Very useful we added to our checklist for making Gitote great!
Meanwhile on the "real internet" I keep finding these
The biggest issue on the web are the images not JS and CSS, you should focus on the biggest ROI.