Improving Video Cache Hits on Swiggy Apps
Article Summary
Swiggy was bleeding money on video bandwidth costs. The culprit? Videos being requested at 270px, 272px, 275px... you get the idea.
Vignesh Muralidharan from Swiggy's Consumer Apps team breaks down how they tackled video cache inefficiency. Despite great UX, their CDN cache hit ratio was terrible because the same video was being transformed hundreds of times at slightly different widths.
Key Takeaways
- Used K-means clustering to bucket video widths into 8 discrete sizes
- Reduced video processing costs by 50% with minimal quality impact
- Cache hit ratio improved dramatically by eliminating near-duplicate requests
- Standard deviation of ~100px per bucket is negligible on modern displays
Critical Insight
By remapping video requests to 8 width buckets using K-means clustering, Swiggy cut video processing costs in half while improving cache performance.