服务器信息:
$ httpd -v
Server version: Apache/2.2.24 (Unix)
Server built: May 8 2013 15:17:37
我使用 openssl 创建了一个自签名 SSL 证书。
测试代码(带有 selenium webdriver 的 Java):
long startTime, useTime = 0, t;
int count = 10;
for (int i = 0; i < count; i++) {
ChromeDriver driver = new ChromeDriver(capabilities);
startTime = System.nanoTime();
driver.get("https://*.*.*.*/pic.html");
//When testing Http,it will be:driver.get("http://*.*.*.*/pic.html");
//pic.html is a simple page with many images.
t = System.nanoTime() - startTime;
useTime += t;
driver.quit();
}
System.out.println("Average Time: " + useTime/1000000.0/count +" ms");
结果:
HTTPs:Average Time: 1718.13659 ms
HTTP:Average Time: 2484.122677 ms
提前致谢。