Back to feed
Dev.to
Dev.to
7/3/2026
The original title is "The Cache Was Working. And Still Causing Duplicate API Calls"

The original title is "The Cache Was Working. And Still Causing Duplicate API Calls"

Original: The Cache Was Working. And Still Causing Duplicate API Calls

Short summary

CommitPulse's caching layer had a thundering herd bug where concurrent cache misses triggered multiple identical GitHub API calls while the first request was in-flight. The fix uses an in-flight Promise map to deduplicate pending requests—subsequent callers share the same pending Promise instead of spawning independent fetches. This pattern prevents rate-limit exhaustion under high concurrent load.

  • Concurrent cache misses caused duplicate API calls despite having a cache
  • Solution: track in-flight Promises separately and return existing pending request to concurrent callers
  • Prevents thundering herd problem that exhausts rate limits under traffic spikes

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more