How to clear Facebook Share’s Cache



Facebook share is good, simple, lets us share almost everything on web in seconds. But Facebook caches already shared urls/pages for better performance. This causes issues at time when we update the title, picture being shared or the description of the page because facebook still shows the older version of the page.



I will discuss three simple ways to force facebook to go and fetch the latest stuff from the page being shared.

Method 1 :

Facebook treats each url as unique and caches the page based on that url, so if you want to share the latest url the simplest solution is to add a query string with the url being shared. In simple words just add ?v=1 at the end of the url. Any number can be used in place of 1,

This method is fairly simple but it doesn’t retain the share count for this page, as it treats this page as a different url hence the count for this url will be restarted from 0. Plus if someone else shares the original url without the querystring the information will still be the old one.

Method 2:

Using url shortner services like bit.ly. shorten your url form bit.ly and then use the new url for facebook share. This too is a simple and quite popular method but has the same issues as the first one.

Method 3:

Facebook has a tool called URL Linter. This tool gives us an idea about how a url will be shared on facebook, what content, which image will be fetched.

We can use this tool for any url and it fetches the latest title, description, excerpt and other stuff that will be shown while sharing the link. If you use an already shared URL with this tool then facebook fetches the latest content, and also updates it cache with the latest content.

With this methos the url remains the same hence the share count will persist only the content will be updated. Someone else sharing the url will also see the latest content now. So this method is the ofcourse the best.

The url linter tool can be accessed on Facebook URL Linter

Comments

User said…
Hi,

Nice post yaar

Popular posts from this blog

How to check browser cookie enabled with php and javascript

cookie and subdomains

Output buffering in php