开发者

Facebook graph api picture loading problem

I'm having this very unusual problem where on a page refresh开发者_开发技巧 all profile pictures that loaded on the previous page refresh no longer load. Instead each image laoded causes these errors in the console:

Resource interpreted as Image but transferred with MIME type text/javascript. Failed to load resource: the server responded with a status of 400 (Bad Request)

Especially weirdly is, if I go on one page where I have say, 3 pictures A B and C. If on the next page I have 5, including A B and C from the last, only D and E will load. If I then refresh only A, B and C will load. This can be repeated forever!

Any ideas as to what on earth explains this?

PS. Not linking my app to start with as I don't believe it's necessary, but if needed I will do.


as loading profile pic via graph api is actually an in-direct way, problem will occur if facebook svr cannot handle your request (giving you the actualy pro file location).

I would suggest getting the static link to the user's profile pic via fql/graph api first and then use it in your app. This will actually boost up your app's performance too (displaying the profile pic via graph api is slow).


This is a temporary Facebook issue and has already been reported by at least two other users and logged with Facebook.


I've been seeing the same issue. And this is not the first time. My solution has been to cache the URL which the graph API redirects to. Never had problems with this URL (hosted on a pretty reliable CDN).


I've encountered this issue with alternating bad requests on profile pictures just now: at a closer inspection of the request header and answer headers, I've found the hint that Facebook doesn't allow P3P queries (not anymore? I thought it worked on my last app).

So, if you have somewhere a statement like

    header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');

just remove it, and perhaps after clearing the browser cache and/or web framework cache, then it should work (if this was indeed the problem, and not coincidentally some Facebook bug).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜