开发者

Facebook Like Button Cache. Linter useless

开发者 https://www.devze.com 2023-03-10 08:22 出处:网络
Looks like an issue was closed related to the question I\'m about to ask, so I wonder if I\'m going to be skating on thin ice, but here goes.I feel like even though this is kind of localized by nature

Looks like an issue was closed related to the question I'm about to ask, so I wonder if I'm going to be skating on thin ice, but here goes. I feel like even though this is kind of localized by nature, it could be a useful example for other developers dealing with the Like button.

I seem to be having issues regarding the Facebook like button. The infuriating part is that I'm pretty confident I have everything setup properly, and even though the linter says "hey, this all looks kosher!" the like button fails to get the correct content and uses cached info from a different page.

Here's the case: referlocal.com. We serve daily deals, and list them right off the homepage. There can be one of many deals listed on that homepage, so obviously Facebook is seeing just one when it goes to take a peek at the root directory. Now, on the homepage, whatever deal your viewing has a FB Like XFBML tag with href and ref attribu开发者_JAVA百科tes set. Every page that displays a deal also has OG tags pointing directly to the offer view page. Deals can also be viewed on user pages. So, on these three paths:

  • /
  • /{username}
  • /offers/{city}/{title-url-alias}

a like button is included as well as OG tags that point to /offers/{city}/{title-url-alias}. For about 3 weeks, the button worked like a champ. But recently, it's been performing strangely. For any deal, regardless of the 3 locations, it always uses the information cached from the previous days "/" deal. Regardless of the OG tags or origination.

Here's the wildly confusing part. The Facebook Linter is supposed to recache the information on the page, right? Well, it sort of does. It picks up on all of the appropriate information set in the OG tags, but when you click the Like button at the bottom of the page, no dice, still uses the deal FB saw on the homepage from the day before.

I know this is probably killing my argument for localization, but check this out:

http://developers.facebook.com/tools/lint/?url=http%3A%2F%2Freferlocal.com%2Foffers%2Fdallas%2Fget-20-of-authentic-italian-american-cuisine-for-only-10-at-leggios-italian-ristorante-dallas

Regardless of the fact that the linter finds all the appropriate information, the like button at the bottom still is liking a deal FB cached from the previous day.

Any ideas?


I had this problem too. The linter caches things in a very weird manner - seems like the best thing to do is either to add a query string and change it every time, or just rename the file every time you're checking.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号