-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Signed Exchanges: understand AMP runtime's needs for serving origin identity #20359
Comments
The AMP Packager transformer transformerIdentifier.go will add the attribute This follows the form of the AMP-Cache-Transform header. It explicitly states the CDN performing the transform and the transformer version used. E.g. |
(Nit: It differs from the AMP-Cache-Transform header in that the version number isn't quoted.) |
It is worth noting that the transformers used in version one include server side rendering transformer which also has hints to the Runtime that server side rendering was performed ( |
/to @jridgewell |
My 2c: There is a manageable number of hard origin checks throughout the runtime. In many cases this is just a proxy signal for whether the document is being loaded in a Google viewer context, so the proposed API should be sufficient. |
Do you have thoughts on which API would be preferred? Is |
Currently there are several configurable data (including origin) that other caches can theoretically override: Lines 24 to 47 in 6f63baf
There are also a few places where cdn.ampproject.org logic is hardcoded e.g. parsing and generating cache URLs. Providing the cache origin would be nice (obviates |
I see. Well, presumably other caches could also provide their own javascript URL on the documents as well. I then propose that we stick with Wherever we have the hard origin checks, we should replace that with a call that checks against |
It may be worth noting that eventually the concept of transformed AMP will come to pages served at origin. The actual attribute value hasn't been determined yet (e.g. Also, an AMP page served from origin could declare |
We discussed this for ~5 minutes offline and concluded that for now The other suggestion that was raised is that other caches could implement these modifications in the future by mandating an alternative source for Closing this issue. @jridgewell for filing any issues that for runtime changes that may be needed. |
@ampproject/wg-ui-and-a11y
With Signed Exchanges, AMP documents will be operating on the publisher origin, even if the document is served from the AMP Cache. By default, the AMP runtime will not be able to determine if the document was served by the AMP cache or the Publisher.
The open question is if the runtime makes any decisions based on the origin being
*.cdn.ampproject.org
, etc. A hypothetical example could be rewriting images inamp-bind
with acdn.ampproject.org
cache URL.If the AMP runtime does not make any such decisions, this issue can simply be closed. If it does, signed exchanges can provide metadata in the document which the runtime can use to make that decision. We should determine what the syntax of this metadata should be.
@honeybadgerdontcare for the syntax of the
<html amp transformed=>
attribute which may be sufficient.If not, we can also do something like:
<meta name="amp-cache-origin" content="cdn.ampproject.org">
The text was updated successfully, but these errors were encountered: