Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support preconnecting target links in a standardized manner. #124

Closed
nicksay opened this issue Oct 27, 2014 · 0 comments · Fixed by #362
Closed

Support preconnecting target links in a standardized manner. #124

nicksay opened this issue Oct 27, 2014 · 0 comments · Fixed by #362
Assignees

Comments

@nicksay
Copy link
Contributor

nicksay commented Oct 27, 2014

Currently, preconnecting to URLs early in navigation or before navigation begins can be done via ad hoc JS. The benefit is to resolve DNS and establish the socket for the connection early, before the request is made, reducing the time it takes to make the request. Support this functionality in a standardized way.

@nicksay nicksay self-assigned this Oct 27, 2014
nicksay added a commit to nicksay/spfjs that referenced this issue Oct 27, 2014
When processing a response, parse `<link rel="preconnect">` tags, and initiate
connections via an `<img>` tag to both preresolve DNS for the target and
preconnect the socket.

For now, guard the feature behind a `experimental-preconnect` config.

Progress on youtube#124.
nicksay added a commit to nicksay/spfjs that referenced this issue Nov 18, 2014
Instead parsing of `<link rel="preconnect">` in order to preresolve DNS for the
target and preconnect the socket, parse `<link rel="spf-preconnect">`.  This
makes it clear that the feature is SPF-specific.

Progress on youtube#124.
nicksay added a commit to nicksay/spfjs that referenced this issue May 11, 2015
Before, preconnect links specified by `<link rel="spf-preconnect">` tags would
be treated like other prefetch resources in that they were only done once.  This
works for static resources, which generally have long cache lifetimes and do not
need to be prefetched multiple times.  However, when preconnecting URLs, the
server's HTTP keep-alive time can close an opened connection before the next
use (or preconnect attempt) occurs.  To ensure that connections are correctly
established, always send requests for preconnect target links.

Progress on youtube#124.
nicksay added a commit to nicksay/spfjs that referenced this issue May 11, 2015
Before, preconnect links specified by `<link rel="spf-preconnect">` tags would
be treated like other prefetch resources in that they were only done once.  This
works for static resources, which generally have long cache lifetimes and do not
need to be prefetched multiple times.  However, when preconnecting URLs, the
server's HTTP keep-alive time can close an opened connection before the next
use (or preconnect attempt) occurs.  To ensure that connections are correctly
established, always send requests for preconnect target links.

Progress on youtube#124.
nicksay added a commit to nicksay/spfjs that referenced this issue May 12, 2015
Before, preconnect links specified by `<link rel="spf-preconnect">` tags would
be treated like other prefetch resources in that they were only done once.  This
works for static resources, which generally have long cache lifetimes and do not
need to be prefetched multiple times.  However, when preconnecting URLs, the
server's HTTP keep-alive time can close an opened connection before the next
use (or preconnect attempt) occurs.  To ensure that connections are correctly
established, always send requests for preconnect target links.

Progress on youtube#124.
nicksay added a commit to nicksay/spfjs that referenced this issue May 12, 2015
Before, preconnect links specified by `<link rel="spf-preconnect">` tags would
be treated like other prefetch resources in that they were only done once.  This
works for static resources, which generally have long cache lifetimes and do not
need to be prefetched multiple times.  However, when preconnecting URLs, the
server's HTTP keep-alive time can close an opened connection before the next
use (or preconnect attempt) occurs.  To ensure that connections are correctly
established, always send requests for preconnect target links.

Progress on youtube#124.
nicksay added a commit to nicksay/spfjs that referenced this issue Jun 29, 2015
Preconnect requests are done by sending image requests to the target URL.
Before, this was done using `img` tags in an `iframe`, just like prefetching
JS/CSS uses `script` or `link` in an `iframe`.  However, this is unnecessary
overhead that can slow down sending the request.  Instead, use a simple `Image`
object to trigger the request.

Progress on youtube#124.
nicksay added a commit to nicksay/spfjs that referenced this issue Sep 18, 2015
When processing a response, parse <link rel="spf-preconnect"> tags, and initiate
connections via an Image object to both preresolve DNS for the target and
preconnect the socket (if the server's HTTP keep-alive time allows).

Closes youtube#124
@nicksay nicksay added this to the SPF 23 milestone Oct 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant