|
|
| ||||
Other Projects | JSZip and CSZipTwo PHP programs for merging js and css files together and outputting them minified, zipped, and cached. Option to pack them as well. The files were originally written by me for the backend of the download manager for JQuery UI 1.0, and I've adapted them for more general use, and upgraded them to PHP5.
When a web page is requested, usually only two requests are delivered at a time, so if there are a lot of scripts and stylesheets, this can result in a significant delay in rendering a web page. By using these programs, only one file is delivered for each type, and by outputting them minified and zipped, bandwidth is significantly reduced along with total bytes served, which is important nowadays when ISPs are charging once a website goes over a given limit. Unless set otherwise, minifying, which uses the excellent JSMin.php by Ryan Grove, is a one off event as the individual files get saved to the server. This way on subsequent requests the minified files are just merged and zipped, so visitors get the files fast. The files can be downloaded from here The zipped file includes JSMin.php and class.JavascriptPacker.php, so it can be up and running straight away. To use them you just set the script and style tags so:
Doing it this way makes it easy to serve different scripts and stylesheets for different pages without having to worry about conflicts. Also, if you change a script or stylesheet, you just need to give it a different name, and change the url using the new name, and visitors will get a single file with the changed file in it. You don't need to use the js or css extensions in the urls, as the programs will add those as required. | JQuery/PHP Website and Applications Developer, based in Ireland. Help me build a supercomputer | |||
| Page Layout and Program Design by Paul Hanlon Page visited 2750 times. | |||||
1 Comment
Post New CommentJust to say I found these very useluf and simple to set up. Thanx.