This is not really a Mustache.js or Handlebars.js specific question but both frameworks would have this problem if you are trying to optimize the performance loading templates for your web app.
Right now I am loading the templates from the same domain as the rest of the app, but I would like to load my templates from the CDN if possible. The largest problem with this is that I can't cross browser can't load text files via AJAX.
What other methods can I try to optimize the load time of individual templates cross domain?
I have worked on optimizing the load order ( worked )
loading the templates as xdomain script files in the head ( failed )
<script type='text/html' src="http://domain.cdn.com"></script>
I think CORs support would be limited to the number of browsers.
Using YQL would be slow.
Can I somehow do what JSONP does, but with an XML, XHTML, or HTML, obviously without the javascript callback? Maybe the end of the template could have a small callback function, but I wouldn't want to wrap the whole thing and need to escape it as json.