Skip to content

Instantly share code, notes, and snippets.

@simonw
Created January 13, 2011 20:34
Show Gist options
  • Select an option

  • Save simonw/778541 to your computer and use it in GitHub Desktop.

Select an option

Save simonw/778541 to your computer and use it in GitHub Desktop.
Hacker news comment that's failing to post
We put a lot of thought in to loading times of the badge. There are some
performance notes here:
http://lanyrd.com/services/badges/docs/#performance
We're serving the initial 2215 byte script from Amazon's CloudFront CDN, so it
should load lightning fast. You can place the script link at the bottom of the
body to make absolutely sure there's no chance of it blocking the load of the
rest of your page.
Once that script has loaded, it looks through the document finding all of the
badge configuration links. It then assembles a single URL to our badge service
which fetches all of the badge data in one HTTP request. This goes through a
10 minute Varnish cache, so it should be nice and fast too and should survive
even if your site is getting a huge amount of traffic.
Finally, the badge degrades gracefully so in the event that Lanyrd.com is down
(again, the Varnish cache is meant to help protect against that) your page
will load fine, you just won't get the badge content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment