It all depends on what you are developing for, but here are some rules of thumb.
HTTP requests mean overhead (especially over HTTPS), so try to do as little as possible, for mobile this is very important. however, there are a few exceptions; Lazy loading JavaScript files that are not needed when initializing the application are sometimes smart, so they are cached when it is really necessary; using CDN for popular libraries can sometimes lead to a significant increase in performance due to parallel downloads.
save as few downloads as possible, so reduce all JavaScript and CSS, some even minimize HTML.
make sure the cached headers are set correctly (some set them for a year or more), and when a new version of your script is deployed, add the src attribute of the script element with the version number for the cache counter, for example: <script src="myapp.js?v=2"></script>
Sometimes perceived performance is better than real performance, which means; Having loaded and processed HTML is more important than an initialized application. this can be done by asynchronously loading JavaScript files (by adding script elements using JavaScript, such as Google, or using script loaders that do this for you). but this leads to new tasks, such as the execution order of the downloaded files or interaction with the page before the script files are fully loaded and parsed.
In the end, it largely depends on the architecture of your online application or site and on what should or should be connected with it, think further by providing a few examples?
PM5544.
PM5544
source share