Background: I favor to help keep my CSS and Javascript in separate .css/.js files. (Reason is they are shared by many people pages so in by doing this, static data in individuals file wouldn't get moved with every page view). This can lead to some pages getting 5-6 "link rel" or "script type" claims.

Now, normally, this indicates browser will make separate request all of individuals css/js files, and effective page load time can increase - say become 5X for five round trip demands (please correct me should i be wrong here).

My real question is:

1) Do modern browsers request keep-alive connections automatically?

2) When they do, then will it imply that additional file sourcing (css/js) won't boost the effective load time? For instance - will the server think that browser will request the css/js files, and therefore keep delivering it (thus staying away from an additional request)?

In a nutshell - can anybody explain when would the burden time NOT increase by getting separate css/js files and when it always increases, then may be the load time increase proportional to the amount of files incorporated?

regards,

JP

  1. Yes, browsers using HTTP/1.1 should generally be utilising keep-alive connections.

  2. The server will not always assume it the keep-alive should mean there is not another DNS research - the file still will get asked for.

If correctly set up, you need to find (which may be verified with Opera+Firebug for instance) the first request creates an ordinary download of individuals files, but subsequent demands generate HTTP 304 (File Not Modified) demands in which the content hasn't transformed because the last load and therefore it ought to be offered by cache.

If it's a genuine concern, you might want to consider using Expires headers to specify lengthy-existence from the files, therefore the request never even will get made (not really the request to ascertain if the file has transformed)