With all the awesome jQuery plug-ins out there, it's so tempting to just start including them all over the place to enhance the look of our website.
I'm looking for some opinions on whether and when I should be concerned about the sizes of these scripts.
Assume they're being cached on the web server level, so I guess the potential concerns are on bandwidth for the scripts being served from the web server, as well as performance on the client browser that needs to download all these scripts.
URLs contain JavaScript files of size over 25 KB. The figure of 25KB is relatively arbitrary – there is no hard and fast rule as to what constitutes an JavaScript file that is 'too large'.
For mobile, aim for a JS budget of < 170KB minified/compressed. Uncompressed this is still ~0.7MB of code.
Large amounts of JavaScript negatively affect site speed in two distinct phases: During page load: big bundles take longer to download. During parse and compile: big bundles take longer to be turned into machine code, which delays JS initialisation.
There are two issues here as you mentioned.
The first is server load. If this is an issue, you can use the Google AJAX Libs APIs, and get your libs directly from Google's CDN.
Second issue is client side loading time. Well, you should decide who your target audience is, and how much you are wiling to let the user wait. As a rule of thumb, most websites today consume ~300KB
of bandwidth per page, including scripts, stylesheets and images.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With