Search code examples
facebook-graph-apiachievements

How to bypass achievements cache without debugger


I have ~40 achievements in my Facebook application. I'm still in dev environement performing some tests with achievements, deleting all of them and recreating them with a different URL but same content, with a batch.

But most of the time, it appears that I cannot recreate the deleted achievements with the Graph API until I've not scraped the URLs with the debugger. But for 40 achievements, it is a lot of time!

I understood that the achievements are cached at Facebook' side, and the debugger allow us to bypass the cache. Is there any automatic solution to "refresh" the cache for 40 achievements at the same time?

Thank you for your help.


Solution

  • You run an API call to the Facebook scraper in your code, which won't reduce the necessity for having to re-scrape, but it will at least automate it for you.

    You simply make a call to:

    https://developers.facebook.com/tools/lint/?url={YOUR_URL}&format=json

    This performs the same action as manually debugging the page, so it will force a rescrape.

    Source: https://developers.facebook.com/docs/opengraphprotocol/#edit