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).
I just found out this is somehow possible. I solved it like so:
$(document).ready(function(){
$.getJSON("http://example.com/staticjsonfile.json",function(data){
//callback function isn't here
}
});
function JsonWrapping(data){
//It's really here
alert(data);
}
This is not ideal, as you loose binding with the event that fired the Ajax request. So some hacking is required. However, it kinda gets the job done. I'd be very open to a better solution.