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; emailAddress=jcisio@gmail.com
* 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:
.
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).