How to clear Facebook Sharer cache?
How to clear Facebook Sharer cache?
We used the link:
http://www.facebook.com/sharer.php?u=[shared URL]
...to share a particular page. However, Facebook Sharer uses the cached version of the images and the title. Is there a way to quickly clear the Facebook cache or how long do we have to wait until the data gets updated?
I placed in between the tags.
Answer by Awais Qarni for How to clear Facebook Sharer cache?
I thing these two links have a wide discussion on your problem related stuff. fb:ref clear cashes by calling
fbml.refreshRefUrl
like this
fbml.refreshRefUrl("http://www.mysite.com/someurl.php")
You can study the related stuff from here fb:ref. I hope it will work for you
Answer by catandmouse for How to clear Facebook Sharer cache?
I found a solution to my problem. You could go to this site:
https://developers.facebook.com/tools/debug
...then put in the URL of the page you want to share. It will automatically extract all the info on your meta tags and also clear the cache.
Answer by Vladimir Pak for How to clear Facebook Sharer cache?
Use api Is there an API to force Facebook to scrape a page again?
$furl = 'https://graph.facebook.com'; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $furl ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_POST, true ); $params = array( 'id' => '', 'scrape' => true ); $data = http_build_query( $params ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $data ); curl_exec( $ch ); $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
Answer by Martin Carstens for How to clear Facebook Sharer cache?
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.
Hat tip:
Answer by Matt Toigo for How to clear Facebook Sharer cache?
The page to do this is at https://developers.facebook.com/tools/debug/ and has changed slightly since some of the other answers.
Paste your URL in there and hit "Debug". Then hit the "Fetch new scrape information" button under the URL text field and you should be all set. It'll pull the fresh meta tags from your page, but they'll still cache so keep in mind you'll need to do this whenever you change them. This is really critical if you are playing with the meta tags to get FB Shared URLs to format the way you want them to inside of facebook.
Answer by Purushothaman Ramraj for How to clear Facebook Sharer cache?
Append a ?v=random_string to the url. If you are using this idea with Facebook share, make sure that the og:url param in the response matches the url you are sharing. This will work with google plus too.
For Facebook, you can also force recrawl by making a post request to https://graph.facebook.com
{id: url, scrape: true}
Answer by Thorkil Kowalski V?rge for How to clear Facebook Sharer cache?
This answer is intended for developers.
Clearing the cache means that new shares of this webpage will show the new content which is provided in the OG tags. But only if the URL that you are working on has less than 50 interactions (likes + shares). It will also not affect old links to this webpage which have already been posted on Facebook. Only when sharing the URL on Facebook again will the way that Facebook shows the link be updated.
catandmouse's answer is correct but you can also make Facebook clear the OG (OpenGraph) cache by sending a post request to graph.facebook.com (works for both http and https as of the writing of this answer).
A post request to graph.facebook.com may look as follows:
POST / HTTP/1.1 Content-Type: application/x-www-form-urlencoded Host: graph.facebook.com Content-Length: 63 Accept-Encoding: gzip User-Agent: Mojolicious (Perl) id=&scrape=true
In Perl, you can use the following code where the library Mojo::UserAgent is used to send and receive HTTP requests:
sub _clear_og_cache_on_facebook { my $fburl = "http://graph.facebook.com"; my $ua = Mojo::UserAgent->new; my $clearurl = ; my $post_body = {id => $clearurl, scrape => 'true'}; my $res = $ua->post($fburl => form => $post_body)->res; my $code = $res->code; unless ($code eq '200') { JIX::Log->warn("Clearing cached OG data for $clearurl failed with code $code."); } } }
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment