This idea is a replacement for me personally -- When i first discovered it in the YUI dependency configurator. Essentially, rather than getting multiple demands for a lot of files, the files are chained into one http request to chop lower on-page load time.

Anybody understand how to implement this on the Light stack? (I saw an identical question was requested already, however it appears to become ASP specific.

Thanks!

Update: Both solutions are useful...(my repetition is not sufficient to comment yet so I am adding some parting ideas here). I additionally came across another blog publish with PHP-specific good examples that could be helpful. David's build answer, though, is making me think about a different approach. Thanks, David!

You will find other ways, two of the most apparent could be:

  1. Develop a tool like YUI which develops a bespoke, unique version in line with the components you ticked as needed to ensure that you are able to still serve the file as static. MooTools and jQuery UI all provide package-contractors such as this whenever you download their package to provide you with probably the most sleek and effecient library possible. I am sure a normal all purpose tool is available available.
  2. Produce a simple Perl/PHP/Python/Ruby script that serves a lot of JavaScript files in line with the request. So "onerequest.js?load=ui&load=effects" visits a PHP script that loads within the files and serves all of them with the right content-type. You will find many good examples of the but personally I am not really a fan.

I favor to not serve static files through any kind of script, however i like to build up my code with 10 approximately seperate small class files without the price of 10 HTTP demands. And So I emerged having a custom build procedure that combines all the most typical classes and processes after which minifies them right into a single file like project.min.js and also have a condition in most my sights/templates which includes this file on production.

Edit - The "custom build process" is really an very simple perl script. It reads in each one of the files that I have passed as arguments and creates them to an alternative file, optionally passing the whole factor through JSMIN (available in most your favourite languages) instantly.

In the command enjoy it appears like:

perl build-project-master.pl core.js class1.js etc.js /path/to/live/js/file.js

There's a great blog publish about this @ http://world wide web.hunlock.com/blogs/Supercharged_Javascript.

What you would like is Minify. I simply authored a walkthrough for configuring it.