I’ve just been given the following feedback on a staging site I have.
There are over 100 lines of JavaScript code [in the footer] which
should be in a separate file for performance, not in the markup.
Although I was under the impression that serving it in the footer was a performance boost given that it is one less http request.
Which is the better method (inline or external) for a production environment?
Keeping the JS in an external file allows it to be cached and reused between pages (or reloads of the same page).
There is a small performance penalty at the time of first load in exchange for a (relatively) big enhancement in future.