-
Notifications
You must be signed in to change notification settings - Fork 381
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
Integrate support for AMP release channels #4600
Labels
Comments
This was referenced Apr 16, 2020
This will also need to account for #4589. |
This was referenced Apr 9, 2021
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Feature description
Follow-up on #4390.
AMP has a new LTS channel in addition to Beta and Experimental channels. The LTS channel gets a dedicated URL while the Beta and Experimental channels are per user opt-in via cookie. Cookie-based opt-in however conflicts with the needs of serving AMP pages via service worker since it means those scripts must be cached by the service worker as
opaque
, meaning that they could consume much more of a site's storage budget than than they would if they had been served withcrossorigin=anonymous
. See ampproject/amphtml#24731 and ampproject/amphtml#27267.The AMP plugin therefore should transition to adding
crossorigin=anonymous
to all scripts (and styles) that it adds to the page. This has an additional benefit of providing more guarantees for user privacy. (Ultimately this won't be necessary once self-hosting of AMP scripts is available per #4530).Update: With the landing of ESM scripts,
crossorigin=anonymous
is now added to all scripts by the AMP Optimizer.Once this is done, we then will also need an alternative to using cookies for sites to opt-in to non-stable release channel(s). In addition to LTS, there is now a way to reference the
experimental
andbeta
channels via a newoptin
query param: ampproject/amphtml#27587. These scripts will not be valid AMP, so when a non-stable release channel is chosen then the document must be put into dev mode.The way to opt-in to a release channel can be accomplished via a filter like
amp_release_channel
which would take one string argument that can be modified by callbacks to be one of:'stable'
(default)'lts'
'beta'
'experimental'
A special value of
false
should also be considered to revert to the current behavior where stable releases are used with nocrossorigin=anonymous
being added, which will allow for cookies to be used to control the AMP version.Note that the Optimizer also needs to add support for LTS channel. See #4589 and ampproject/amp-toolbox#691.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
amp_release_channel
filter.crossorigin=anonymous
to all scripts.QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: