I remember last year our team took over a video streaming project, not long after the line bandwidth costs on the table, the boss almost did not open me, that's when I really appreciate the high-defense CDN is not just anti-attacks, but also in the money-saving play on the flowers.
Video this thing, especially HD or 4K streams, bandwidth consumption is like a bottomless pit, each additional user to watch, the cost of rubbing up, not to mention those DDoS attacks from time to time to come to life, although the traditional CDN can cache the content, but improperly configured instead of increasing back to the source of the pressure, I have found that a lot of teams focus on the flow of traffic statistics, but ignored the caching strategy and compression optimization, wasted! 30% or more bandwidth.
The root of the problem lies in the distribution of video content, most platforms directly with ordinary CDN, cache time is set too short or did not distinguish between static and dynamic content, resulting in frequent user requests back to the source, the server load is high, the bandwidth is naturally burned, coupled with the video file is usually very large, the transmission is not compressed, like a truck carrying cotton, inefficient, security, lack of high-defense features, if an attack on the bandwidth costs soared, these days even the CDN have to ‘prevent teammates' - it may be which configuration error will pit itself. Bandwidth costs soar, these days, even CDN have to 'defense teammates' - maybe which configuration error will pit themselves.
Intelligent caching is not simply set an expiration time on the line, it has to be based on the type of content, user behavior dynamic adjustment, such as popular video cache for a longer period of time, cold content to shorten the cache, to reduce unnecessary back to the source, I commonly used to optimize the HTTP cache header based on HTTP cache headers, such as Cache-Control and ETag, with the edge of the CDN computation, so that the request is as much as possible to solve the problem in the edge of the node, don't be old! back to run.
Here I share a Nginx configuration example, I have tested it can effectively reduce the return rate, assuming that you use CDN5 service, their intelligent caching module is quite strong, but the configuration has to be manually tweak.
Don't believe in those one-size-fits-all cache settings, score the scenarios, such as live streaming with short caching, on-demand video with long caching, CDN07 is doing a good job in this regard, their intelligent algorithms can automatically learn the traffic pattern, but I still like to manually adjust, because the real test, the automatic mode will sometimes be overcaching, resulting in content expiration.
Compression technology is another bandwidth-saving tool, video files are already compressed, but the transmission of metadata, subtitles and API response with Gzip or Brotli compression, can be slimmed down quite a lot, Brotli is more efficient than Gzip, especially for text content, I tested and found that after enabling Brotli, the JSON response is smaller than 20%, and the overall bandwidth dropped by 10-15%. The overall bandwidth dropped by 10-15%.
Here's a sample Apache configuration to enable compression, assuming you're using 08Host's CDN, whose compression is built-in but needs to be activated.
Some teams are afraid that compression will increase CPU overhead, but in fact, modern servers handle this more than enough to compare CDN service providers: CDN5 compression algorithms are conservative, save bandwidth but slightly higher latency; CDN07 Brotli support is good, high compression rate; 08Host is prominent in the security of compression, with DDoS protection, to avoid compression is abused, the actual test data to see. Comprehensive intelligent caching and compression, bandwidth consumption down 30% is not blowing - my own project from 100TB per month down to 70TB, real money saved.
Don't forget to monitor and tweak, use tools like Google Analytics or a self-built monitoring system to track cache hit rates and compression ratios, and optimize your configuration on a regular basis, otherwise set it up and leave it alone, and the results will be compromised.
In short, the core of the video high-defense CDN to save bandwidth in the refinement of the management, intelligent caching to reduce the source of the return, compression to reduce the transmission volume, coupled with high-defense features anti-attacks, the cost of natural down, the industry pit, but as long as you test and optimize, don't follow the wind blindly, you can play around, haha, now I look at the bandwidth bill are not panicked - on the contrary, a little small complacency.

