Gzip 压缩无法通过 HTTPS 运行

发布于 2024-09-14 00:40:19 字数 472 浏览 5 评论 0原文

我通过 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

楠木可依 2024-09-21 00:40:19

在您的安全站点的 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.

空城旧梦 2024-09-21 00:40:19

您可能应该 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文