Oct
22
2008

Facebook profile boxes are a great way for an application to improve the user experience and also provide publicity for the application. However, it is not so great when the profile box consists of a bunch of broken links to missing images.

There are currently 29 bugs reported against the Facebook image caching mechanism. Some of these problems have been around for over a year, so there is valid reason to be concerned.

Fortunately there is a method you can use that forces Facebook to re-cache your image when calling setFBML.

By appending the current time to the image name, Facebook believes the image to be new and saves it as a new image.

<img src="http://www.mysite.com/images/image.jpg?refresh=<? echo time(); ?>" />

Use this on all your profile box images to ensure you always have valid content displayed.

2 Responses to “Facebook Profile Boxes – Image Issues”

  1. MrA says:

    Hmm, can you please explain better on email or something?

  2. Bev says:

    MrA, The purpose of putting the time after the image name is that the FB cache considers it a new picture even if it had been cached before. So a new copy is saved and displayed in the profile box. Without the timestamp, calling profile_setFBML with an image that had already been used would not refresh the image but would re-use the cached copy. Hence, when the image caching bug rears its ugly head (leaving broken images in your profile box) you can force FB to use a new copy of the image using this trick.