ColdFusion Inserting JavaScript in the Head

So I discovered today that ColdFusion does some processes that I’m not sure I like too much. This all came about in my process of trying to optimize my site for performance. In creating a high performance website it is crucial that you Properly including stylesheets and scripts (link from Google Developers). This is also talked about at Yahoo Best Practices for Speeding Up Your Web Site. (Both resources are excellent if you are looking to speed up your browsing experience for your users)

ColdFusion, unfortunately, in using tags such as CFFORM, CFAJAXPROXY and others inserts JavaScript in the top of the head tag. So here are two reasons why this is bad:

  1. In order to make your page load faster it is best to place your CSS code first in the head (after title) and your JavaScript code just before the body tag.
  2. The first tag in the head should be a meta tag specifying the character set to prevent XSS attacks. (UTF-7 XSS Cheat Sheet)

Other Issues
Another major issue noted by users is where the parser used by ColdFusion to insert the script tags inserts the tags incorrectly breaking the page. As noted here: ColdFusion: CFAJAXPROXY and the HEAD tag, and at Stackoverflow.