I know this is to move the Javascript and css to the footer and I have asked the developer to do so but he says this:
Actually, this is not an issue but an alert we can say. The thing is, to solve this we have to move JavaScript at footer but by doing this, it will arise new issue related to website functionality.
Generally, this kind of alerts does cause any harm to our website, none of the website will be having score more than 85 Desktop and 65+ in Mobile (Even Google score is 61 in Mobile and 92 in Desktop).
Hence do not worry much about this kind of alerts
So I want to know if his saying is true or if he should indeed carry on with that task?
Normally it’s best practice to place JS links at the bottom of the page. Any issue with doing this here is probably easily resolved (although there usually isn’t a problem).
Eliminate … CSS in above-the-fold content
It’s a popular thing to do these days. It involves working out what CSS is critical for the styling “above the fold” and moving those styles from the linked style sheet to the actual page (in the head of the document). Personally, I think it’s a waste of time, but if you want to squeeze every little bit of performance, then give it a try. But first deal with those JS scripts, as well as optimizing the rest of your code and of course images and other assets.
I think you have to treat what Page Speed Insights suggests with an element of caution. For one of my sites, it suggested a change that would save 1 byte, and another it was suggesting I optimize a couple of Google’s own scripts!
Yes, same problem with one of my sites where Google Analytics is preventing me from getting the final 4% because of the following recommendation:
Leverage browser caching
The workaround is to use a PHP Cron job to save the JavaScript file to a sub-domain that does not use sessions. Without the Cron job Google Analytics stops working after a couple of days because their script requires an upto date version.
cause the page to render “cleaner” and potentially faster if placed in the <head> section of the page. Those exception scripts are few but do exist.
The exceptions are the one line scripts that need to run before the page starts to load because they either are changing the way the page will look (eg. your example) or are deciding whether or not to load the page at all (eg frame breakers).
In very rare cases these exception scripts can be more than one line of code (eg. Modernizr).
The one thing these scripts have in common is that they need to be run BEFORE the page starts to render and therefore they can’t go at the bottom of the page where all the other more normal JavaScript can go.