【发布时间】:2010-12-13 00:06:11
【问题描述】:
我在我的网站上使用 Bluehost SSL 证书保护了我的结帐页面,并且该页面经常会被下载而不是呈现。
这仅在我使用 ssl 时发生,如果我在没有它的情况下运行网站,则页面加载正常。
有什么办法可以防止这种情况发生吗,我试过放置
<?php header("Content-type: text/html"); ?>
在页面顶部,但这并不能解决问题。以下是问题发生时下载的文件头示例:
HTTP/1.1 200 OK
Date: Sun, 12 Dec 2010 23:42:18 GMT
Server: Apache
X-Powered-By: PHP/5.2.14
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
以下是正确加载时的标头示例:
HTTP/1.1 200 OK
Date: Mon, 13 Dec 2010 03:04:08 GMT
Server: Apache
X-Powered-By: PHP/5.2.14
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
Keep-Alive: timeout=10, max=28
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
【问题讨论】:
-
当问题没有发生时,标题是什么?
-
我后来尝试使用Charles Web Debugging Proxy调试站点,发现当Charles使用自己的证书时没有问题。问题是否可能是 bluehost 使用的实际证书?
-
我认为问题可能归结为
Connection: close,而应该是Connection: Keep-Alive- 这纯粹是基于您发布的成功和不成功响应标头之间的差异。 -
连接关闭是我要解决的问题。我尝试将“Connection: Keep-Alive”放在标题中,但没有解决问题。