ampproject / ampproject/amp-toolbox

ITI: Asset URL rewriting in AMP Optimizer

Open
#862 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
HTML
Stars
459
Forks
242
PR merge metrics
No merged PRs in 30d

Description

Moving the conversation here based on https://github.com/ampproject/amppackager/issues/449

We’d like to move forward with adding AMP Packager compatibility mode to the AMP optimizer.

From the previous issue:

> The important thing to note is that in the near future, transformers won't need to produce byte compatible AMPHTML to the AMPPackager. This will greatly simplify things and means that transformers only need to produce valid AMP. So you will be able to use AMP Optimizer out of the box. However, for performance reasons, asset URL rewriting to cdn.ampproject.org is critical in the SXG case and should be added to AMP Optimizer. This could be enabled via a flag as an "AMPPacker compatibility mode".

We feel comfortable in adding in a new flag ( `--amp-packager-mode`?). The base URL would default to `cdn.ampproject.org`, but could be changed to support different AMP caches (is this what the `AMP-Cache-Transform` request header is for?).

Contributor guide

Open the contributing guide

Research direction

Review the prior AMP Packager issue linked in the description and the proposed --amp-packager-mode flag. Determine how the base AMP cache URL and AMP-Cache-Transform behavior should work; done means AMP Optimizer rewrites asset URLs for SXG compatibility while allowing a configurable cache base URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
tooling, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.