Only the files necessary to display the above-the-fold content (the content displayed on the users’ viewport on initial load) should be loaded first. All secondary resources e.g JavaScript files can be loaded after the DOM is rendered.