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
I would also add a bit of request-side logic to validate the Accept and AMP-Cache-Transform headers and save that in the StreamInfo for the response filter.
They are similar but not exact. Two important differences:
amppkg rewrites various subresource URLs to point to the Google AMP Cache (source) and optimizer doesn't; this is signified by the <html transformed> attribute, either google;v=N or self;v=N
The HTML serializers are different. Currently, Google's internal AMP SXG validator is very picky about the HTML serialization, so it's unlikely to pass unless it runs through an exact port of this printer.
There may be other differences (in terms of the set of transformers that are run), though. We haven't intended the optimizer for use in an SXG, so it was never vetted. You'd probably have to compare the two codebases (or grep validator protoasciis for transformed). You also run the risk of some old transform becoming invalid in the distant future, as we rev our versions, though we haven't invalidated anything yet. Note that the risk is mitigated: If it fails AMP SXG validation, it should still be able to pass normal AMP validation for display in the viewer.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
To follow up to @twifkak's comment. The validator will utilize what is written in it's engine and protoascii defined rules to determine if a document is valid. There should not be any divergence from those rules to what is allowed when the attribute transformed is present on the html tag. As time goes on, more rules may change for the transformed type identifier.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.
Activity
cpapazian commentedon Jan 21, 2020
cc: @twifkak
twifkak commentedon Jan 21, 2020
I would also add a bit of request-side logic to validate the
AcceptandAMP-Cache-Transformheaders and save that in the StreamInfo for the response filter.cpapazian commentedon Jan 22, 2020
@twifkak are the optimizations/transformations in https://github.com/ampproject/amppackager/tree/releases/transformer the same as those implemented in https://github.com/ampproject/amp-toolbox/tree/master/packages/optimizer? another option is to implement the cache friendly optimizations in our frontend web server as we render the AMP HTML, and only do the SXG packaging/signing in the envoy filter.
twifkak commentedon Jan 22, 2020
@Gregable @honeybadgerdontcare re: transformed AMP validation
They are similar but not exact. Two important differences:
<html transformed>attribute, eithergoogle;v=Norself;v=NThere may be other differences (in terms of the set of transformers that are run), though. We haven't intended the optimizer for use in an SXG, so it was never vetted. You'd probably have to compare the two codebases (or grep validator protoasciis for
transformed). You also run the risk of some old transform becoming invalid in the distant future, as we rev our versions, though we haven't invalidated anything yet. Note that the risk is mitigated: If it fails AMP SXG validation, it should still be able to pass normal AMP validation for display in the viewer.Also, I've attempted to document the AMP SXG validation requirements; hopefully you find some of that useful.
cpapazian commentedon Jan 23, 2020
cc: @nainar @jeffjose
stale commentedon Feb 22, 2020
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
honeybadgerdontcare commentedon Feb 25, 2020
To follow up to @twifkak's comment. The validator will utilize what is written in it's engine and protoascii defined rules to determine if a document is valid. There should not be any divergence from those rules to what is allowed when the attribute
transformedis present on thehtmltag. As time goes on, more rules may change for thetransformedtype identifier.stale commentedon Mar 26, 2020
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
stale commentedon Apr 2, 2020
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.