Optimizing Bandwidth Cost and User Experience in Bilibili's VOD Player through Intelligent Caching and Preloading Strategies
Bilibili’s VOD player cuts bandwidth waste and costs by up to 15% through an intelligent caching and pre‑loading system that evaluates network risk and user habits to size cache dynamically, reduces stalls by 20% in vertical mode, and is continuously refined via a multi‑layer monitoring framework.
In Bilibili's video‑on‑demand (VOD) business, bandwidth cost dominates the total cost (transcoding + storage + bandwidth). The company has long used technical means to reduce bandwidth expenses.
Because bandwidth cost = bandwidth price × bandwidth usage, there are two typical reduction methods: (1) lower the bandwidth price, e.g., by switching to cheaper CDN services; (2) lower the bandwidth usage, e.g., by optimizing encoding algorithms to compress the bitrate while keeping visual quality.
Previous optimizations focused on the server side, while the player—the final consumption point—received little attention. Data‑driven analysis by the Bilibili player team revealed a large optimization space in the player’s bandwidth usage, achieving a 15% reduction in VOD bandwidth cost since early 2022.
1. Waste in VOD Bandwidth
The premise for reducing player bandwidth cost is to keep high‑definition, smooth playback. Therefore, the goal is to identify bandwidth consumption beyond normal playback and minimize waste.
1.1 Causes of Waste
Most waste comes from excessive caching, especially cache data that is never played. Scenarios include early exit, pre‑loaded but unplayed content, backward seeking, and resolution switching.
1.2 Measuring Cache Waste
The team first considered a simple metric—download bandwidth per unit time—but found it unsuitable across different playback lengths. They introduced a second metric that normalizes for playback duration, confirming that short plays waste far more bandwidth than long plays.
Using this metric, they observed that the bandwidth redundancy rate (the proportion of bandwidth beyond actual consumption) exceeds 30% without pre‑loading and can reach 50% with pre‑loading.
2. Balancing Cost and Experience
Fixed cache watermarks were originally set to mitigate network jitter, which was beneficial in early internet conditions. With modern stable networks (4G/5G) and low‑latency live streams, excessive cache now adds cost without improving experience. Data shows two user groups: Group A (over‑cached, no stalls) and Group B (under‑cached, prone to stalls). A dynamic approach is needed to keep the cache just enough for smooth playback while avoiding waste.
3. Technical Optimization Measures
3.1 Intelligent Caching Strategy
The team designed a real‑time decision engine that evaluates network risk and user habit to compute the minimal cache required for smooth playback.
Network Risk
Speed risk – historical bandwidth vs. video bitrate.
Jitter risk – variability of past speeds and network type switches.
Stall risk – probability of consecutive stalls within a recent window.
The combined risk is fed into a formula (illustrated below) to decide the cache size.
User Habit
Cache hit rate – likelihood that the user will continue watching without seeking.
Playback speed – higher speeds consume cache faster; the model incorporates speed into cache calculations.
Combining network risk and user habit yields an intelligent cache policy that reduced bandwidth cost by 10% while keeping stall metrics unchanged.
3.2 Intelligent Pre‑loading Strategy
In Bilibili’s vertical‑screen mode, pre‑loading provides near‑zero first‑frame latency. The initial naive approach launched multiple download tasks simultaneously, leading to high bandwidth redundancy (up to 50%) and sub‑optimal stall rates.
Analysis identified two sources of stall during pre‑loading:
Start‑up competition – many parallel downloads slow down the primary video’s initial load.
Ongoing competition – without a real‑time pause mechanism, pre‑load tasks continue to consume bandwidth when the network degrades.
The new intelligent pre‑load module receives real‑time inputs (network state, video metadata, priority, user actions) and decides for each task whether to start, pause, or set a target cache duration.
Key rules include:
Do not pre‑load when network is extremely poor.
When network is excellent or playback is short, only pre‑load a tiny initial segment.
When network is moderate and playback is long, pre‑load more to guard against future jitter.
Implementation notes: avoid creating many download tasks immediately after switching to vertical mode; respect user preference for vertical playback; ensure pause actions affect both application‑layer and socket‑layer buffers; keep connections alive for long sessions.
The refined strategy cut stall rate by 20% and, together with the intelligent cache policy, saved another 20% of bandwidth in vertical mode.
4. Long‑Term Monitoring System
A multi‑layer monitoring framework supports continuous optimization:
Long‑term KPI dashboard – tracks trends and identifies bottlenecks.
Daily KPI report – summarizes yesterday’s changes and triggers alerts.
Real‑time anomaly alerts – minute‑level detection and root‑cause analysis.
AB‑test real‑time analysis – second‑level query tool for rapid experiment feedback.
This system enables stable, data‑driven iteration of player strategies.
5. Conclusion and Outlook
Video playback technology is foundational for the internet. Balancing cost reduction and user experience requires precise risk identification and algorithmic/engineering optimizations. The presented intelligent caching and pre‑loading techniques demonstrate that both goals can be achieved simultaneously, and the monitoring infrastructure ensures ongoing improvements as network conditions and user expectations evolve.
Bilibili Tech
Provides introductions and tutorials on Bilibili-related technologies.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.