Does Windows Azure Blob Storage support serving compressed files similar to Amazon S3?

吃可爱长大的小学妹 提交于 2019-11-30 05:14:47

问题


For example, at Amazon S3, there is a convention, if you have both 'bundle.js' and 'bundle.js.gz' uploaded to the server, and a client requests for 'bundle.js' file with 'Accept-Encoding: gzip' header, Amazon S3 will serve the compressed version of this file ('bundle.js.gz' instead of 'bundle.js').

Does Windows Azure Storage support this? If not, what are workarounds?


回答1:


Azure Storage allows you to define Content-Encoding property on a blob. For compressed content, you could set this property to be GZIP and when this content is served by a browser, it automatically decompresses the content and shows the uncompressed content.

This is a bit different than Amazon S3 though where you actually have to upload 2 files. Here you will only upload one file (bundle.js in your example) which is compressed and has content-encoding set as GZIP.




回答2:


As of 12th August 2015 Azure CDN (mounted on blob storage) now supports automatic GZip compression.

Compression method - Supported compression methods are gzip/deflate/bzip2, a supported method must be set in the Accept-Encoding Request Header.

Improve performance by compressing files



来源:https://stackoverflow.com/questions/23263129/does-windows-azure-blob-storage-support-serving-compressed-files-similar-to-amaz

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!