...

View Full Version : does a css- or javascript-file delay?



jess_quna
11-13-2011, 02:32 PM
Hello,
I was wondering;
what loads the fastest?
When you put the css-code in the html-file
or when you make an additional css-file?
And what about javascript?
Greetings and thank you for your time.

BubikolRamios
11-13-2011, 08:05 PM
the rules says to put ref to js file into head section. Often it shows that it is better to put it at the end of HTML.

For firefox get yourself httpfox addon, and you will see what is downloaded when.

Apostropartheid
11-13-2011, 11:41 PM
Technically when you put CSS inline, as there is no need for an additional HTTP request for the same amount of content.

However, if you put the CSS in an external file, it is cached, meaning it doesn't need to be downloaded again. This results in lots of bandwidth and time savings in the long run.

In reality, the difference is negligible, so save yourself the bytes and put it in an external file.

Excavator
11-13-2011, 11:46 PM
Hello jess_quna,
That's not really a valid question. Load times for either one will depend more on how well they are written and what they are doing.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum