【发布时间】:2017-12-15 06:34:34
【问题描述】:
应用程序托管在使用 Apache 版本 Apache/2.4.18(Ubuntu) 的 AWS 环境中。我已经使用 .htaccess 启用了压缩,它在我的本地系统环境中运行良好。但不是在 AWS 环境中。
除 Ajax 请求外,所有其他 Web 请求都使用 Gzip 在 AWS 上进行压缩。我是否需要启用其他任何东西。
这是我使用的 .htaccess 代码。
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
【问题讨论】: