This is my general question as when we hit home page how server know only this css, javascript and html files I need to send to the user and all this file are sent at same time?
When a request is sent, the first thing to come back down is the HTML file. From that the DOM is constructed. When the HTML comes down the next thing is to request the CSS and script files. The order matters so for the sake of avoiding issues, load the CSS file(s) before running any script. After that, the media are requested and downloaded.
2 Likes