Swiggy Jun 20, 2023

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

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.

The article includes the actual code implementation and explains why this bucketing strategy needs continuous monitoring as your app evolves.

Recent from Swiggy

Related Articles