4 ms·
About signed http exchanges, the new feature being announced and used by amp: Say you have a site that links to other pages on your site, and you want the link
by AgentME 8y ago
About signed http exchanges, the new feature being announced and used by amp:
Say you have a site that links to other pages on your site, and you want the links to be instant. After a user loads a page on your site, you can have javascript on your page preload the content of the links on your site, so when the user clicks on one, you can instantly update the URL and show the new page. (You could even do something clever like only preload the content of links that are visible on the screen currently, or that the user is moving the mouse toward.)
The above only works on links within your own site, because 1) there's no way your javascript can render something onto the screen with someone else's domain in the URL bar, 2) if the user's browser is pre-fetching the content directly from the linked sites and if users can post links to arbitrary sites on your page, then someone can get the IP addresses of all of your visitors by posting a link to your site, which may be preloaded by everyone's browsers who visit your page, regardless of whether users actually click the link, and 3) the user already has an open connection to your site, so preloading would be quickest if the data came from your site instead of potentially dozens or more of other sites. Point #1 could be solved by browsers implementing the prefetching logic, but that doesn't solve points #2 and #3.
Now imagine that your server could download signed and packaged versions of all of the pages linked to on your site, and then have your javascript preload that data from your server into your users' browsers, in a way where the users' browsers can verify the signature of the data to know that it really came from the linked sites and display it if the user visits any of the links on your site. That's what signed exchanges enables.
- walterbell 8y agoDoes the origin site lose advertising and analytics?
- SimeVidas 8y agoThis is Google. If this technology weren’t compatible with their ads and analytics, they wouldn’t push it.
- TrueDuality 8y agoNot necessarily, the payload can contain javascript that will run if the content is actually loaded. This would allow most advertising and analytics scripts to continue to work.