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

⚡ Optimize the purchase flow by prefetching and preconnecting from/to ti.to #112

Merged
merged 1 commit into from
Mar 6, 2018

Conversation

cramforce
Copy link
Member

@cramforce cramforce commented Mar 4, 2018

Prefetches the main doc and known sub resources whenever a doc finishes loading.

On mouseover and click of the purchase button, preconnects to ti.to and other origins that ti.to uses to flatten the connection tree.

@cramforce cramforce changed the title ⚡ Optimize the purchase flow by prefetching and preconnecting from/t… ⚡ Optimize the purchase flow by prefetching and preconnecting from/to ti.to Mar 4, 2018
@cramforce cramforce requested a review from lukaszklis March 4, 2018 20:43
if (Date.now() > new Date('2018-07-01').getTime()) {
return;
}
addLink('prefetch', 'https://ti.to/jsconfeu/jsconf-eu-2018');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity: Does prefetch have a positive effect on (html) resources with max-age set to 0?
Aren't cache headers respected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefetch has special caching semantics and allows using the resource once within 5 minutes (or something like that) even if it has expired per its max-age.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Are you aware of any document describing that behavior? Could not find it here: https://w3c.github.io/resource-hints/#prefetch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not aware, but it definitely works :)

CC @igrigorik

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robin-drexler @cramforce indeed, works in Blink-based browsers.. Not 100% on other browsers. This is an un-specced corner of the platform, see: w3c/preload#97

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to you both. :)

… ti.to

Prefetches the main doc and known sub resources whenever a doc finishes loading.

On mouseover and click of the purchase button, preconnects to ti.to and other origins that ti.to uses to flatten the connection tree.
@cramforce cramforce merged commit c3f9dff into jsconf:master Mar 6, 2018
@cramforce cramforce deleted the preconnect-tito branch March 6, 2018 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants