Post date: 2009-04-13 12:46This release of DAP brings a new feature that will merge two or more web resources together.
When speeding up a web site the number of HTTP-requests is the top parameter to adjust for best performance.
The top ranking Yahoo Developer performance article has "Make fewer HTTP-requests" as its number one thing to do to reduce page load time. (http://developer.yahoo.com/performance/rules.html)
DAP-Merge can in runtime combine many JavaScript’s or CSS files into one saving the server and web client a lot of HTTP-requests.
The syntax is simple - to combine two JavaScripts into one use this syntax:
<script type="text/javascript" src="/dap/merge?/scripts/prototype.js|/scripts/scriptaculous.js"></script>
Each file is separated with a pipe char |
All merged content is of course cached and you can also use the JS-Min feature to minify the scripts you are combining. GZip is applied when applicable.
I have modified dominoExperts to Merge, JS-Minify, GZip and Cache all the JavaScripts used and I have saved 8 HTTP-requests and 220 kB of data in the process. The compression ratio for the combined JavaScripts is 82% and the single resulting file is served right from the server's memory.
I can keep a lot of verbose comments in my JavaScript files knowing that they will not slow down the site because JS-Min will remove them in runtime.
I can still modify any of the merged files and simply do a hard reload (Ctrl-Shift while clicking the reload icon) and force the DAP cache to update with the latest changes.
Download DAP 1.10 here
|