开发者

serving gziped files only - a good idea?

开发者 https://www.devze.com 2022-12-08 19:19 出处:网络
I have a web service that serves widgets. For scalability sake I want to keep gzipped versions of the js files on Amazon S3. The thing is that browswers not able to accept gzipped files will not be se

I have a web service that serves widgets. For scalability sake I want to keep gzipped versions of the js files on Amazon S3. The thing is that browswers not able to accept gzipped files will not be served.

Anyone know where开发者_运维百科 I can find statistics to know how many of the potential users will not be served? Is it a good idea in general?


See this page from the mod_gzip pages. It has a breakdown of which browsers support what.


Yes it is a good idea - as far as I know all modern browsers accept gzipped content. One thing you can do to prevent older browsers from being served gzipped content is to tell the web server to not gzip the output for such browsers. Here's an apache example (excerpt from a .htaccess):

AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application
/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
0

精彩评论

暂无评论...
验证码 换一张
取 消