I’ve recently started developing a web application in Laravel using the Twig templating engine and I ran into a problem trying to get the full page url as a variable in the template.
In order to optimise performace, Facebook caches website information when you share it on your wall. This can then show incorrect information when you update your website content. In particular the shared thumbnail image.
Here are a few scenario’s that I have been in when it comes to sharing links on Facebook.
- My facebook share link is showing an old/different image to what it should be
- I shared a Facebook URL and it’s not showing a thumbnail
- There’s no video preview when I share a Vimeo/YouTube video
There are various ways that have been suggested in order to update a facebook share link but there’s only one tool that you really need to fix the problem (and it’s provide by facebook themselves).
Fixing your Facebook shared link and thumbnail
I have found that there’s quite a simple solution to clear the Facebook URL sharing cache. Facebook has a tool that not only refreshes the sharing cache but also provides page details to help you find out the cause of the problem.
Check out the Facebook Object Debugger Tool.
When you’re building websites, it’s a very handy link to have in your collection of development tools.