我試圖在我的個人資料頁面的「更新狀態」下共享鏈接,例如http://apps.facebook.com/appname/。修改應用程序的內容後,它仍顯示緩存。我試圖使用http://developers.facebook.com/tools/debug清除緩存,但結果仍然相同。任何幫助將不勝感激。如何清除共享鏈接緩存?
0
A
回答
0
- 等待。
- 嘗試再次將該網址粘上去或告訴任何人爲你做(可能有imedate效果)
- 等等。
0
試試這個:
$fbURL = 'https://developers.facebook.com/tools/debug/og/object?q=';
$shareURL = '<YOUR URL>';
$excuteURL = $fbURL.urlencode($shareURL)."&format=json";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $excuteURL);
//curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
$data = curl_exec($ch);
curl_close($ch);
請注意,您需要通過用戶代理,因爲這是由Facebook的服務器需要解析請求。
4
您可以直接使用Object Debugger。只需將您的網址粘貼到那裏,然後點擊調試。
你可以告訴Facebook的重新刮使用「刮=真」的帖子在POST請求https://graph.facebook.com參數的內容。在Facebook docs的更多細節。
0
我有這個問題,但它是與特定的崗位,而不是整個網站。我在調試器中獲取緩存以在更新博客文章後顯示正確的圖片,但是當我將鏈接發佈爲狀態時,Facebook仍顯示舊圖片。我不想等了一天,看它是否最終會改變,所以我做了什麼網頁中列出:
https://webapps.stackexchange.com/questions/18468/adding-meta-tags-to-individual-blogger-posts
換句話說,這樣的事情:
<b:if cond='data:blog.url == "http://urlofyourpost.com"'>
<meta content='http://urlofyourimage.png' property='og:image'/>
</b:if>
基本上,你要將一個if語句硬編碼到你的頁面的HTML中,以便爲你改變那個帖子的任何內容而改變meta內容。這是一個混亂的解決方案,但它的工作原理。
0
以上方法並沒有爲我工作。但是,我已經使用JavaScript來清除緩存並在Facebook中獲取最新內容。
if(window.location.search.indexOf("facebook_refresh") >= 0) {
//Feature check browsers for support
if(document.addEventListener && window.XMLHttpRequest && document.querySelector) {
//DOM is ready
document.addEventListener("DOMContentLoaded", function() {
var httpRequest = new XMLHttpRequest();
httpRequest.open("POST", "https://graph.facebook.com", true);
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState == 4) {
console.log("httpRequest.responseText", httpRequest.responseText);
}
};
//Default URL to send to Facebook
var url = window.location;
//og:url element
var og_url = document.querySelector("meta[property='og:url']");
//Check if og:url element is present on page
if(og_url != null) {
//Get the content attribute value of og:url
var og_url_value = og_url.getAttribute("content");
//If og:url content attribute isn't empty
if(og_url_value != "") {
url = og_url_value;
} else {
console.warn('<meta property="og:url" content=""> is empty. Falling back to window.location');
}
} else {
console.warn('<meta property="og:url" content=""> is missing. Falling back to window.location');
}
//Send AJAX
httpRequest.send("scrape=true&id=" + encodeURIComponent(url));
});
} else {
console.warn("Your browser doesn't support one of the following: document.addEventListener && window.XMLHttpRequest && document.querySelector");
}
}
相關問題
- 1. C++共享內存泄漏,如何清除共享內存?
- 2. 如何在共享圖像和文本時清除Facebook緩存
- 3. 如何清除Facebook的共享緩存(非調試器沒有)
- 4. 如何共享緩存?
- 5. Chromecast:如何清除接收者緩存
- 6. PhoneGap如何共享鏈接?
- 7. 用cURL和lint清除Facebook共享緩存
- 8. Laravel 5.3 - 在共享主機中清除配置緩存
- 9. 如何清除Sprockets緩存?
- 10. 如何清除imagekit緩存
- 11. 如何清除UserPrincipal緩存
- 12. 如何清除html緩存
- 13. 如何清除Flash緩存?
- 14. 如何清除StructureMap緩存?
- 15. 如何清除Jest緩存?
- 16. 如何清除UIWebView緩存
- 17. 如何清除weblogic緩存
- 18. 如何清除ResourceBundle緩存
- 19. 如何清除gradle緩存?
- 20. 如何清除MKMapView緩存?
- 21. Minify,如何清除緩存?
- 22. Facebook共享緩存
- 23. SQLite共享緩存
- 24. ASP.Net緩存共享
- 25. 是否可以使用緩存清除共享首選項?如果是,那麼如何清除它?
- 26. windows azure:共享緩存 - 全部刪除?
- 27. Facebook共享鏈接時分享鏈接
- 28. 共享緩存共享模板?
- 29. 清除緩存
- 30. 緩存清除