News for hackers. Stuff that matters.
Re:The only script in your head by kqueue on Tuesday November 30, 2010 @11:30PM (#1956815)
IMHO, websites should include a single js file. In development you can have 100 js files, but in production these should be combined into a single file.

The downside is that you might include things you don't need in all pages, but that's not an issue because the file is transferred once, and cached. This will also minimize future conditional GET requests that check wether the cached file has changed or not.

Re:The only script in your head by superk on Wednesday December 01, 2010 @01:18PM (#1958834)
I'm not sure I agree with this. I don't think a user should have to re-download all the JS on the site if I just change a single line. Small changes probably happen frequently and shouldn't invalidate the entire JS cache. If I were using a framework like jQuery, I would link that separately from a 3rd-party CDN like Google. Then all the shared behavior would be another request, and page specific code a third. In most cases I would be changing the page specific code which would only invalidate the cache for that request on that page. IMO that's a better compromise.