You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 with crossorigin=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 and beta channels via a new optin 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.
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: