1

I am at present introducing code to my site to combine css and javascript files. Is there a way without having to include an external library to load javascript asynchronously or in parallel?

I have read on some blogs that combining of files can be counter productive as the load of the http request can be large and its better to load multiple files in parallel. Opinions on this? I am caching my javascript/css. And would have thought it was better to combine rather than have multiple http requests.

amateur
  • 43,371
  • 65
  • 192
  • 320
  • I'd imagine that splitting them up is better as well but this probably depends a lot on the client environment, being varying OS and browser with varying TCP/IP connection limitations and whatnot. To test out a bit for yourself though you can probably use the developer tools built in to chrome, in win hit ctrl+shift+i otherwise go to the little wrench and hit tools->developer tools, in there go to the timeline tab, then hit the record button in the bottom and reload your page, and wallah results :) – shaunhusain Jan 08 '11 at 15:46

2 Answers2

0

Ah looks like my assumption was probably wrong but I bet this depends a whole lot on the particulars of the scenario, how many pieces etc. Very large HTTP request vs many small requests hope it helps.

Community
  • 1
  • 1
shaunhusain
  • 19,630
  • 4
  • 38
  • 51
0

checkout headjs demo at http://headjs.com/test/script.html

dpree
  • 16