使用gzip的HTML页面服务从亚马逊S3 [英] Using GZIP with html pages served from Amazon S3

查看:303
本文介绍了使用gzip的HTML页面服务从亚马逊S3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道服务使用Amazon S3 gzip压缩的HTML页面的任何问题。我有必要尽量减少我们的HTML文件的大小(即提供了COM pressed HTML,CSS和JavaScript文件) - 但我关注的是,无论是:

Does anyone know of any problems serving gzipped HTML pages using Amazon S3. I have the need to minimize the file size of our HTML files (ie serving up compressed HTML, CSS and javascript files) - but am concerned that either:

  1. 亚马逊S3不能正确地服务​​了gzip压缩的文件,请求它的浏览器。或者,

  1. Amazon S3 does not serve up gzipped files correctly to the browser that requests it. Or,

有些浏览器无法阅读gzip压缩的内容。我明白旧的浏览器不支持gzip压缩的内容(如IE6及更早版本) - 以及一些(现代?)反病毒软件会剥夺内容编码头

Some browsers have trouble reading gzipped content. I understand older browsers do not support gzipped content (such as IE6 and earlier) - and some (modern?) anti-virus software will strip the content-encoding headers.

我需要来提供uncom pressed HTML(我相信亚马逊S3将很容易支持) - ?或者我可以放心,最现代的浏览器将处理我的gzip压缩的内容好吗

Do I need to serve up uncompressed HTML (which I believe Amazon S3 will support easily) - or can I rest assured that most modern browsers will handle my gzipped content okay?

推荐答案

gzip压缩文件并上传之前添加下面的元数据输入到S3对象是:

Gzip the file and add the following metadata entry to the S3 object before uploading it:

Content-Encoding=gzip

这篇关于使用gzip的HTML页面服务从亚马逊S3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆