标记和通过https SSL的最后修改? [英] Etags and last-modified over https SSL?
问题描述
是否可以通过安全的HTTPS连接对条件GET请求使用HTTP缓存?我已经在非安全HTTP上进行了缓存,但是当我切换到HTTPS时,浏览器将停止发送if-none-match和if-modified-since标头,因此缓存会中断。我尝试了各种Cache-Control设置,例如public,max-age = 3600等,没有骰子。
Is it possible to use HTTP caching for conditional GET requests over a secure HTTPS connection? I've got caching working over non-secure HTTP, but when I switch to HTTPS the browser stops sending if-none-match and if-modified-since headers, so the caching breaks. I've tried various Cache-Control settings like public, max-age=3600 and whatnot, no dice.
在Safari和Chrome中都会发生这种情况,所以我假设SSL以某种方式破坏了它。
This happens in both Safari and Chrome, so I'm assuming the SSL is breaking it somehow. Is caching not allowed over SSL?
请注意,服务器确实正确设置了etag和最后修改的标头,但是根据Chrome开发者工具,浏览器不会在请求中发送if-none-match和if-modified-。
And just to be clear, the server is indeed properly setting the etag and last-modified headers, but the browser is not sending if-none-match and if-modified-since in the request, according to the Chrome developer tools.
谢谢
推荐答案
弄清楚了!原来,您必须拥有受信任的证书。我正在使用用于SSL HTTPS的自签名测试证书。将其添加到我的钥匙串中并使其变为绿色即可进行缓存。
Figured it out! Turns out you have to have a trusted certificate. I was using my self-signed test certificate for SSL HTTPS. Adding it to my keychain and turning it green made the caching work.
这篇关于标记和通过https SSL的最后修改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!