Commit: 89d7374 (Jan 8, 2020) File: td/telegram/files/FileDownloader.cpp:163-168
if (streaming_offset == 0) {
cdn_supported = true;
}
The commit message says: "Temporarily disable CDN if streaming is enabled." — marked as temporary but has been in place for ~6.5 years with no follow-up.
cdn_supported is initialized to false and only set to true when streaming_offset == 0. Any download with offset > 0 or a bounded limit results in cdn_supported=false in the upload.getFile request, so the server never replies with upload_fileCdnRedirect. The download goes through the origin DC instead of a CDN edge.
Questions:
-
Protocol limitation or missing implementation? — Is there a fundamental MTProto restriction where CDN servers reject offset > 0 requests? The upload.getCdnFile TL schema accepts a plain int offset parameter, which suggests partial CDN reads should work?
-
Would accepting the redirect and then requesting the partial range from the CDN work? — If the initial upload_getFile(cdn_supported=true) returns an upload_fileCdnRedirect, the client could use upload_getCdnFile(offset, size) with the non-zero offset directly against the CDN. Is there any known server-side issue with this?
-
Is there intent to re-enable this?
Commit: 89d7374 (Jan 8, 2020) File: td/telegram/files/FileDownloader.cpp:163-168
The commit message says: "Temporarily disable CDN if streaming is enabled." — marked as temporary but has been in place for ~6.5 years with no follow-up.
cdn_supportedis initialized tofalseand only set to true whenstreaming_offset == 0. Any download withoffset > 0or a bounded limit results incdn_supported=falsein the upload.getFile request, so the server never replies with upload_fileCdnRedirect. The download goes through the origin DC instead of a CDN edge.Questions:
Protocol limitation or missing implementation? — Is there a fundamental MTProto restriction where CDN servers reject
offset > 0requests? The upload.getCdnFile TL schema accepts a plain int offset parameter, which suggests partial CDN reads should work?Would accepting the redirect and then requesting the partial range from the CDN work? — If the initial upload_getFile(cdn_supported=true) returns an upload_fileCdnRedirect, the client could use upload_getCdnFile(offset, size) with the non-zero offset directly against the CDN. Is there any known server-side issue with this?
Is there intent to re-enable this?