We have video (mp4) files on the Google Storage with the CDN enabled. The videos are pseudo-streamed (HTTP byte-range) well from all but one of our users. All videos have same format, were encoded by ffmpeg with the same parameters. All videos are streamed well from different locations (especially tested from USA and Europe).
Just one user from South Korea reports he cannot stream some videos, but can stream the others well. He has tried 3 different devices (Windows, iPhone, Android tabled) with same result. He has tried to switch to mobile network (LTE) and still had the problem. We do not know if other users in South Korea have same problem or not, we have not many users there.
Is it possible the PoP or GCC nodes in the South Korea serve little different data than elsewhere? Is it possible to test HTTP requests to the same PoP, GCC nodes as the Korean users from Europe?
Update: After a few more test with the user we have found that the video downloaded (by curl
) is correct. He has problem with some fresh videos, too, so the problem is not in caching. The problem arises, when the video has index at the end, so the player has to seek to the end of file first (HTTP byte-range
). (But not always, he can play some videos with the index at the end).
Data is not served differently depending on location. To make an HTTP request from a remote location, I would suggest spinning up a VM instance with a container, with a ready VPN server (1) in a region close to the remote location you are looking for (2). In this case, it's either Taiwan or Singapore (3) closest to test your service from.
As you can see, cached responses must have a body of under 10 MB, otherwise they won't be cached (5). Still, the documentation offers a tip for large files caching, towards optimising outgoing traffic with Cloud CDN Interconnect (4). It would seem that Cloud CDN is not a proper service for video streaming. Can you tell me how do you handle in your back-end the video streaming through HTTP? Do you partition somehow the files before sending data in the responses? You can also check your logs, to see if data is being sent from the cache to the users, or from the back-end. (6)
According to (5), the only stored responses are the ones having the status code 200/203/300, etc., along with other conditions to be respected. Usually, according to RFC 7233 (7), successful partial content responses are coded with the 206 HTTP status code. This means that Cloud CDN does not implicitly support caching partial content. Still, please bear in mind that Cloud CDN does respect the RFC 7234 specifications (8), in the sense that byte range requests are optional when using caching ("A cache MAY complete a stored incomplete response by making a subsequent range request"). My opinion is that only full content responses are being cached, while requests for "chunks" are proxied to the origin server and the responses are not getting inserted into the cache.