Modern web sites and applications require the use of many javascript and css files. If not done with care this can affect the user's experience. One of the easiest methods to improve the performance is by concatenating and minimizing the individual files into bundles, reducing this way the number of downloads and the total size to be downloaded.
One problem with this approach though is that during development phases it's important to work with the original source files, so it's easier to debug or perform changes in them. From the developer's point of view it's ideal to work with small files.
Zend Framework offers an interesting way to include external javascript and css files in your pages. The headLink and headScript view helpers allow to include files in the page at any point in the execution which will be finally added to the head section of your layout just before sending the page to the browser. Since all the files are actually added to page at the end of the request we can override those helpers and filter their contents to replace the individual files with our bundles.