Just curious if there's a reason why you regenerate a large chunk of javascript on each page load (i.e. a dynamic file of javascript that gets pushed out to the browser on each page load). Is it for convenience / ease of development only?
The reason that I ask is that the dynamic file is set to never cache, and is fairly large in size and pushing that each time a page loads is a waste of bandwidth and a performance. Have you considered splitting this into two files, one long-term cachable (libraries, jquery plugins, etc) and the other much smaller file could continue to be dynamic? This would end up allowing the browser to cache the majority of the javascript and not request it from the server each time, plus would save on PHP generation time.
Just a thought.