2

I have a remote server, which is about 390 ms ping delay. The server is nginx with ssl (spdy/2). When I use curl to fetch a small resource, it takes mostly 2 seconds.

* About to connect() to i.vtcdn.com port 443 (#0)
*   Trying 115.84.182.206...
* connected
* Connected to i.vtcdn.com (115.84.182.206) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES256-SHA
* Server certificate:
*    subject: description=xEM5CLkye0fR7K9Q; C=FR; CN=i.vtcdn.com; [email protected]
*    start date: 2012-08
*    expire date: 2013-08
*    subjectAltName: i.vtcdn.com matched
*    issuer: C=IL; O
*    SSL certificate verify ok.
> HEAD /sites/all/libraries/requirejs/require.js HTTP/1.1
> User-Agent: curl/7.27.0
> Host: i.vtcdn.com
> Accept: */*
> 
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx/1.4.1
Server: nginx/1.4.1
< Date: Tue, 14 May 2013 22:12:40 GMT
Date: Tue, 14 May 2013 22:12:40 GMT
< Content-Type: application/x-javascript
Content-Type: application/x-javascript
< Content-Length: 14845
Content-Length: 14845
< Last-Modified: Sun, 19 Aug 2012 17:50:13 GMT
Last-Modified: Sun, 19 Aug 2012 17:50:13 GMT
< Connection: keep-alive
Connection: keep-alive
< Vary: Accept-Encoding
Vary: Accept-Encoding
< ETag: "50312755-39fd"
ETag: "50312755-39fd"
< Expires: Thu, 13 Jun 2013 22:12:40 GMT
Expires: Thu, 13 Jun 2013 22:12:40 GMT
< Cache-Control: max-age=2592000
Cache-Control: max-age=2592000
< Accept-Ranges: bytes
Accept-Ranges: bytes

< 
* Connection #0 to host i.vtcdn.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):

In Chrome, it takes less than a second:

screenshot.

I don't think it is possible. Is there any prefetch? I also have consistent result when fetching this script in page page (the main HTML takes 1 second to process on the server side and return, than the JS file finishes loading before the 2 second mark, so only about 1 second itself).

3
  • Just guessing here... but I'd imagine that Chrome is not factoring the time it takes to establish the TCP connection and negotiate SSL in it's display.. just the time it takes to download that file after the tcp connection is established and SSL has been negotiated.
    – user143703
    May 14, 2013 at 22:40
  • 1
    You could use tcpdump to have a (timestamp enhanced) look at what really happens and check how honest Chrome is. May 14, 2013 at 23:04
  • 4
    Perform a TCPDUMP, transfer using Chrome/Curl. Compare the times in your capture. Also keep in mind that since your site appears to be SSL, Chrome probably already has a SSL session cached, and doesn't need to negotiate the SSL session. Completely close/restart Chrome between each test.
    – Zoredache
    May 14, 2013 at 23:05

1 Answer 1

1

Just want to give an answer to close this question: Chrome reuses the SSL session (all tabs share the same network process), so it bypasses the TLS handshake in my test.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .