![]() ![]() Identify opportunities for code that can be removed or lazily loaded in with DevTools code coverage. ![]() It helped CertSimple save 17% on the size of compressed JS bytes and LinkedIn save 4% on their load times. Brotli outperforms gzip on compression ratio. At minimum, use gzip to compress text-based resources.Use babel-minify or uglify-es to minify ES2015+.Lazily loading in code that is non-critical.Module bundlers like webpack support code-splitting. Use code-splitting to break up your JavaScript into what is critical and what is not.You can reduce the network transfer cost of JavaScript through: You can be on coffee-shop Wi-Fi but connected to a cellular hotspot with 2G speeds. This can be a problem, even in first-world countries, as the effective network connection type a user has might not actually be 3G, 4G or Wi-Fi. Sending more bytes of JavaScript over the wire takes longer the slower a user’s connection is. When most developers think about the cost of JavaScript, they think about it in terms of the download and execution cost. Delivering less JavaScript can mean less time in network transmission, less spent decompressing code and less time parsing and compiling this JavaScript. In this article, we’ll cover why a little discipline can help if you’d like your site to load and be interactive quickly on mobile devices. Patterns for reducing JavaScript delivery costĪs we build sites more heavily reliant on JavaScript, we sometimes pay for what we send down in ways that we can’t always easily see. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |