Amazon CloudFront或Azure CDN是否支持HTTP范围请求的动态压缩



AWS CloudFront和Azure CDN可以在特定情况下动态压缩文件。但是它们是否也支持HTTP范围请求的动态压缩?我在谷歌云存储文档中找不到任何提示。

Azure:

范围请求可以被压缩成不同的大小。Azure Front Door要求任何GET HTTP请求的内容长度值都相同。如果客户端发送带有接受编码标头的字节范围请求,导致Origin使用不同的内容长度进行响应,那么Azure Front Door将返回503错误。您可以禁用Origin/AAzure Front Door上的压缩,也可以创建规则集规则来从字节范围请求的请求中删除接受编码。

请参阅:https://learn.microsoft.com/en-us/azure/frontdoor/standard-premium/how-to-compression

AWS:

响应的HTTP状态代码

CloudFront仅在响应的HTTP状态代码为200、403或404时压缩对象。

-->范围请求的状态代码为206

请参阅:https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206

Yes, Azure CDN also supports dynamic compression for HTTP range requests wherein it is known as ‘object chunking’. You can describe object chunking as dividing the file to be retrieved from the origin server/resource into smaller chunks of 8 MB. When a large file is requested, the CDN retrieves smaller pieces of the file from the origin. After the CDN POP server receives a full or byte-range file request, the CDN edge server requests the file from the origin in chunks of 8 MB

After the chunk arrives at the CDN edge, it's cached and immediately served to the user. The CDN then prefetches the next chunk in parallel. This prefetch ensures that the content stays one chunk ahead of the user, which reduces latency. This process continues until the entire file is downloaded (if requested), all byte ranges are available (if requested), or the client terminates the connection

此外,对象分块的这种能力依赖于源服务器支持字节范围请求的能力;如果原始服务器不支持字节范围请求,则下载大于8mb大小的数据的请求将失败

请找到以下链接,了解有关上述内容的更多详细信息:-

https://learn.microsoft.com/en-us/azure/cdn/cdn-large-file-optimization#object-分块

此外,请找到以下链接,了解有关支持的Azure CDN配置文件的压缩类型和压缩性质的更多说明:-

https://learn.microsoft.com/en-us/azure/cdn/cdn-improve-performance#azure-微软配置文件中的cdn标准

一些测试表明,当在AWS CloudFront中启用动态压缩时,范围支持将被禁用。因此,Range和If Range标头将从所有请求中删除。

最新更新