What should I make use of to instantly incorporate css/js documents?
I have actually currently resolved this concern in another question
In knowledge, I need to have asked it on Webmasters as opposed to the Programmers website.
You have 3 alternatives:
- Let your structure manage it instantly
- Let your webserver manage it instantly
- Roll your very own alternative to do it by hand
Option 1 (making use of a CakePHP expansion):
Download and also install AssetPacker right into your website (which additionally calls for jsmin and also CSSTidy). Change your a couple of lines of resource that include the js documents. Clean - > Rinse - > Repeat. Voila, the remainder is done instantly for you.
If you make use of a few other structure, opportunities are, there is a device that will certainly complete this for you. It is a rather usual need in the webdev globe.
Alternative 2 (making use of an Apache mod):
Take an appearance at the Google Pagespeed mod for Apache. It does every little thing you define and also a great deal even more.
Make certain to check your manufacturing web server is sources though. Some individuals have actually been seeing concerns where this raises load on their web server laid-up. I'm negative yet it might call for an enough fixed web content approach to be a reliable alternative.
If you actually desire, you can create some PHP magic that concatenates JS documents web server side and also incorporates all the link rel enjoys one yet ... That is specifically what both approaches are currently doing anyhow.
Directly, I 'd highly discourage this alternative.
Regarding I recognize Sprockets concatenates JS submits the like AssetPacker, it is simply applied as a Ruby Gem. What it does not do is minify the js code. So, if you utilize it, it is possibly an excellent suggestion to order the jsmin treasure also. For information on how to use Sprockets + JSMin in CakePHP check this out.
I recognize I place focus on CakePHP yet ... I'm thinking that, if a plugin can be adjusted to CakePHP, it needs to be unimportant to adjust it to a various structure also.
For ASP.NET tasks, I have actually made it a component of my construct procedure based upon instructions by Karl Seguin.
Karl defines it ideal on his blog, yet the brief variation is to set up a console application covering YUICompressor. After that you can set up a blog post - construct job to call that console application versus the area of the JS documents in your website.
A fast google search locates this to incorporate CSS documents : http://www.tothepc.com/archives/combine-merge-multiple-css-files/
For this recognizing Python could in fact serve. You can find out Python rather promptly. I began concerning 2 weeks earlier and also my first application (which still isn't ended up) is mosting likely to do the specific very same point you desire. Like the DotLess compiler it will certainly have a watch function that will certainly consider documents or directory sites and also if they transform it will certainly create a new documents.
Python is additionally wonderful for various other upkeep jobs and also I read a great deal of system adminsitrators like to utilize it.
If your webapp remains in PHP you need to take into consideration making use of minify :