Tech Note: Latency and the Facebook Like Button
Here’s one of those tech notes that usually turns into an open thread, with some information that might be useful to other website monkeys.
While testing the Facebook Like button I noticed that there seems to be a latency problem somewhere in the mammoth Facebook hivemind. If the button is clicked shortly after a post appears at LGF, the number changes to ‘1’ but then immediately goes back to nothing, and the Like doesn’t appear at your Facebook Wall. After an undetermined amount of time, the button starts working properly, and the counter “sticks” instead of vanishing. To make it a little more frustrating, it doesn’t happen with every post.
While checking to see if there was something about LGF’s code that was causing this, I discovered Facebook’s URL Linter app, and plugged in the URL for one of the problem pages. It showed no errors. But wonder of wonders, the Like button that had been misbehaving suddenly started working.
Running the URL Linter must update whatever caches are not getting flushed, or whatever transaction isn’t being committed across their DB servers. I hope Facebook fixes this problem soon.
In the meantime, to make this process a bit easier I wrote a quick Javascript bookmarklet that does the Lint operation with one click, for whatever page is currently displayed in your browser. Here’s that bookmarklet, for anyone geeky enough to know what I’m talking about (install in the usual bookmarklet way):