What is a Signed Exchange?
A signed exchange is a file format, defined in the web packaging specification, that allows the browser to trust a document as if it belongs to your origin. This allows you to use first-party cookies and storage to customize content and simplify analytics integration. Your page appears under your URL instead of the google.com/amp URL.
About Signed Exchange
A signed exchange allows you to use first party cookies to customize content and measure analytics. Your page appears under your URL instead of the google.com/amp URL. Google Search prioritizes linking to content as signed exchange over using the Google AMP Viewer in browsers that support signed exchange. To provide users with results in this format, you must publish AMP content as a signed exchange in addition to the regular AMP HTML format. Currently, signed exchange is only supported in Google Search for rich results and basic results, not carousels.
Google Search links to signed exchanges when the publisher, browser, and the Search experience context all support it. As a publisher, you will need to publish both the signed exchange version of the content in addition to the non-signed exchange version.
Serve AMP using Signed Exchanges
MP provides speed benefits above and beyond the format through techniques like caching and preloading. These benefits can have downsides like extra URLs being displayed when embeded inside an AMP Viewer. By serving AMP content using Signed Exchanges, you can use a new web platform feature to overcome all of these.
A Signed Exchange response is made up of a valid AMP document and the original URL of the content. This information is protected by digital signatures that securely tie the document to its claimed URL. This enables browsers to safely display the original URL in the URL bar instead of the hostname of the machine that delivered the bytes to the browser.
Signed Exchange AMP content is delivered in addition to (rather than instead of) regular AMP content.
To implement Signed Exchanges, you must meet the following requirements:
- Your site must be hosted on your own HTTPS server and not from a shared host.
- The ability to generate AMP signed exchanges, such as by running
amppackager
, as a Go binary, or within a Docker VM.- Ability to update the packager every six weeks.
- Ability to Vary on
Accept
andAMP-Cache-Transform
headers on edge HTTP servers, returning different content for the same URL. - Your system running the
amppackager
needs to be able to make outgoing network requests to:- The certificate authority that issues your certificate
- The publisher server that hosts the AMP documents to sign
cdn.ampproject.org
to obtain the current version of AMP
- A persistent shared storage filesystem between all instances of
amppackager
running in the same data center.
Implementing Signed Exchanges
Below is the suggested order of implementation to support Signed Exchanges on your AMP documents.
- Acquire a supported TLS certificate
- Determine which URLs will be signed
- Deploy packager to a staging server
- Publish content and direct traffic