Gzip 压缩无法通过 HTTPS 运行
我通过 .htaccess 中的以下内容为我的网站启用了 gzip 压缩:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
这工作正常,内容针对未加密的连接进行压缩,但是当发出安全请求时,不会压缩任何内容。有什么想法吗?
我的服务器正在运行 Apache/2.2.14
I have enabled gzip compression for my website via the following in my .htaccess:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
This works fine and content is compressed for unencrypted connections, however when secure requests are made nothing is compressed. Any ideas?
My server is running Apache/2.2.14
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的安全站点的 Apache 配置(即涉及端口 443 和 SSL 的部分)中,检查您是否已通过 AllowOverride 指令启用 .htaccess 文件的使用。
您当前的AllowOverride指令可能位于仅与服务器的非安全端口80访问配置相关的部分中。
In your Apache configuration for your secure site (ie the bit where it talks about port 443 and SSL) check that you have enabled the use of .htaccess files with an AllowOverride directive.
It's possible your current AllowOverride directive is within a section pertaining only to the configuration of non-secure, port 80 access to your server.
您可能应该 RTFM 通货紧缩应该由服务器自动协商客户端位于 SSL 层,而不是 HTTP 层。
C
You should probably RTFM deflation should be negotiated automatically by the server and client at the SSL layer, not the HTTP layer.
C