SofaScore logo


Sofascore is the world’s premier provider of live scores, statistics, and sports insights. With data for over 20,000 competitions in 25+ sports, we provide the most comprehensive livescore coverage anywhere. Follow scores, standings, teams, players, tournaments, and leagues, plus get real-time live score notifications so you never miss a play, they also offer In-depth sports analysis with visualisations and data from top-tier providers.

sofascore.com
Industry: Gaming
Location: Global
Customer since: 2024


Favorite features
Fastly CDN
VCL

SofaScore delivers real-time sports data to 34.5 million users with Fastly


The challenge


Sofascore CTO Josip Stuhli has been with the company since its founding over 15 years ago, watching it grow from a small startup with just the founders and two developers into a global sports platform. The free app provides live sports statistics across 23 different sports, with a particular focus on soccer, serving users in countries spanning every continent, including Antarctica. With Brazil as their largest market, Sofascore monetizes through ads, making cost optimization critical to their success.


The platform faced a unique challenge in managing its traffic patterns. Users don't stay online constantly; they open the app in response to push notifications when something happens in a match. When a goal occurs in a major game, millions of users receive notifications simultaneously and open the app at the same time, creating a 20x traffic spike that can easily overwhelm infrastructure. "Every spike, every big game that was happening would bring us offline," Stuhli explained.


To handle these spikes, Sofascore initially built its infrastructure around Varnish caching and later moved from cloud services to on-premises servers for cost efficiency. They implemented a sophisticated cache invalidation system capable of tracking the exact URLs with updated data, purging hundreds of thousands of URLs every minute on data changes. While this worked internally, the limitations of their previous CDN provider created hurdles. Rate limits on URL purges and unreliable purge success rates led to stale content issues. "If you have 99.9% success rate, that's still 1,000 purges that will not get done properly, so we will have stale content," Stuhli said. To work around these limitations, the team had to reduce cache time to live to three seconds and deploy their own Varnish instances worldwide, essentially building part of a CDN themselves.


These challenges made it clear that Sofascore needed a new solution capable of addressing massive, sudden traffic spikes while maintaining fast, reliable delivery of dynamic data — without the inefficiencies and complexities of their existing setup.


The solution


When Fastly approached Sofascore, Stuhli was immediately interested. The team tested the platform and discovered it could handle their demanding purge requirements.


Caching dynamic content with Instant Purge


With Fastly, Sofascore achieved a 97% cache hit rate during normal traffic, climbing to 99% during peak events. Fastly’s Instant Purge capability - averaging 150 milliseconds globally - meant they could finally cache highly dynamic content without serving stale data. "We now have a system that's really fast and really performant," Stuhli said. "Our varnishes utilize much less bandwidth because we now don't have to do the work we had to do with Cloudflare."


The team eliminated their worldwide Varnish infrastructure, simplifying operations while maintaining performance. For regions like Brazil, they had reduced average response time from 200 milliseconds to 20 milliseconds. For Australia, the improvement was even more dramatic — from 500 milliseconds to 80 milliseconds. "That's the difference between I see a loader and I don't see a loader in the app," Stuhli noted.


Building custom logic at the edge with VCL


Fastly's support for custom VCL code opened up possibilities that weren't available with their previous provider. When Sofascore launched premium content behind a paywall, they needed to verify JWT tokens while keeping the content cached. "We want it to be cached on Fastly and not going to our backend," Stuhli explained. Using VCL, they implemented JWT validation directly at the edge — rejecting invalid requests without touching their origin servers.


To address challenges unique to their business, Sofascore combined Fastly's configurable VCL with signals from Fastly Bot Management to create a custom solution that tackles specialized data scraping. "In Fastly, you have bot management, which is great and it works, but also the TLS fingerprint is free for all," Stuhli said. "So if you want to do your own custom logic, something simpler but something that works, you can do that within the confines of your current account." This tailored approach allowed Sofascore to protect its data without relying on costly add-ons or external tools.


Real-time visibility for faster debugging


The flexibility of Fastly's logging capabilities proved invaluable for troubleshooting. Unlike their previous CDN, which offered only predefined log fields, Fastly lets Sofascore log any header they want and send logs to multiple endpoints. "I just write my own log line. I can do whatever I want," Stuhli said. The team can tail logs in real time via syslog with just a couple seconds of latency, enabling them to spot and fix issues immediately.


When the team deploys configuration changes, they can see the impact second by second in Fastly's dashboard. "When you fix it, you can immediately see that it's now OK," Stuhli noted. This real-time feedback loop was impossible with their previous provider's one-minute resolution, making debugging faster and more efficient.


Key takeaway


Sofascore recently reached a record 34.5 million monthly active users and continues to grow, with major sporting events like the 2026 World Cup in the US driving further expansion. By moving to Fastly, the team gained the caching performance and flexibility they needed to handle extreme traffic spikes while delivering real-time sports data to a global audience. "Any issue that we come across gets solved, and that's something that is really, really important," Stuhli said. "We know that bandwidth is never gonna be an issue for us because every peak is gonna get handled by Fastly."


"With Fastly, Sofascore achieved a 97% cache hit rate during normal traffic, climbing to 99% during peak events. We now have a system that's really fast and really performant.”

Josip Stuhli
CTO, SofaScore



"Fastly’s Instant Purge capability is super - averaging 150 milliseconds globally - so that we could finally cache highly dynamic content without serving stale data."

Josip Stuhli
CTO, SofaScore



"We had reduced average response time from 200 milliseconds to 20 milliseconds in Brazil and from 500 milliseconds to 80 milliseconds in Australia. That's the difference between I see a loader and I don't see a loader in the app."

Josip Stuhli
CTO, SofaScore



"Any issue that we come across gets solved, and that's something that is really, really important. We know that bandwidth is never gonna be an issue for us because every peak is gonna get handled by Fastly."

Josip Stuhli
CTO, SofaScore

Sie möchten loslegen?

Setzen Sie sich mit uns in Verbindung oder erstellen Sie einen Account.