I have a large amount of static/rarely changing data in JSON format. To improve my ASP.NET MVC application performance, I would like to move them to a CDN (Amazon Cloud Front).
However when I do that, the cross domain policy kicks in and jQuery makes a HTTP OPTIONS method call instead of HTTP GET and Amazon denies the requst with "403 Forbidden" response.
JSONP might be a way around this but since the files are static and on a CDN there is no way to wrap the JSON in a custom function. However I can recreate them wrapped with a known function name. For example:
{"LineDetails":{"LineNo":"3109","DbId":9 ....}}
I can do something like:
JsonWrapping({"LineDetails":{"LineNo":"3109","DbId":9 ....}});
The "JsonWrapping" function name will be the same for all the files.
Is it possible for jQuery to download JSON data via JSONP if it is wrapped in the same function name as shown above? My reading of jQuery JSONP is that jQuery creates some custom one time use function name for the JSONP request. Can this be overridden?
Thanks for your help.