The Facebook developer app has a field called "Early Flush" that tells Facebook to load your static resources right away for Canvas Applications. For example, your style.css and/or javascript.js files. It requires JSON format, but I can't figure out for the life of me what format its looking for. I've tried all sorts of variations of [] and {}. The old discussion forums indicates it needs to be in this format, but this doesn't make sense nor does it work. http://forum.developers.fac开发者_开发技巧ebook.net/viewtopic.php?id=91799
[{
"name":"All",
"pattern":".*",
"resources":
["http://www.myapp.com/resource.css",
"http://www.myapp.com/flash.swf"]
}]
Can anyone tell me how to format this so that Facebook loads my style.css and javascript.js files quickly?
Take a look at the Canvas Prefetching section of this document:
https://developers.facebook.com/docs/reference/javascript/
I think what you need is FB.Canvas.Prefetcher.addStaticResource
精彩评论