Clear cached Facebook share content.
I recently updated some description text on a page that contained Facebook share functionality, but Facebook wasn't displaying the text I had just updated. Why? Caching.
As you can imagine, a website the size of Facebook needs to have some scaling qualities and caching is definitely one of them. Once the link was shared for the first time, Facebook fetched the page, parsed it and cached the content that it found. Here's a few tips and tricks to beating the Facebook share cache, so you can update your Facebook share content and have it take effect immediately.
Unfortunately, the Facebook share documentation does not mention how to expire their cached content. Basically, you have a couple of options available:
- Changing the url by appending a query string, e.g. http://example.com?t=1289797014 (using a unix time stamp) or even a more simple approach, http://example.com?v=1 (using a arbitrary version number).
- Using Facebook's URL Linter tool to enter your url. By submitting your website here, Facebook will fetch, parse and override it's content with the content it retrieves from the lint process.
In addition to clearing the cached content, the URL Linter tool gives you a run down of how Facebook sees the page and some stats about how regularly it has been shared on Facebook.
Cool huh, and easy too!