if you want to go deeper, look up:
- aws, google cloud & stripe docs on their recommended retry strategies
- thundering herd
up next: circuit breaker pattern, it's the next level up from retries
junior devs write code assuming the network never fails
mid-level devs add retry blocks to handle the failures
senior devs know those exact same retry blocks might eventually take down production
let's talk about this 👇
quick checklist for your retry logic:
- backoff
- jitter
- max delay
- retry limit
- logging
and remember, some things you shouldn't retry at all
- bad requests
- non-idempotent requests (eg payments)
- reqs that already succeeded but timed out - you might duplicate the action
github's actual 503 page says:
"The Unicorns have taken over. We're doing our best to get them under control."
i always thought this was quirky branding
touche @github
TIL why GitHub shows a unicorn when their service is down 🦄
they use Unicorn, a Ruby HTTP server, to serve their app
when the server crashes, the unicorn gets angry
the Easter egg is literally just their tech stack lol
it gets better.
unicorn's own README describes itself as an HTTP server that has "done decades of damage to the entire Ruby ecosystem due to its ability to tolerate (and thus encourage) bad code."
the maintainer literally roasts their own project in the docs
think of it like impersonating a browser instead of just hitting an endpoint
open devtools, copy what works, remove what you don’t need
beats guessing every time
most scraping bugs are just header bugs
your script gets blocked or returns garbage? check if your headers match what the browser sends
saved me countless hours
DO NOT MIX HEADERS FROM DIFFERENT SOURCES
chrome user agent + random headers from a blog/stackoverflow/reddit means you’re telling the website ‘I’m definitely not a real browser’
copy all headers from the same browser. chrome is safest since it’s most traffic anyway