-
Notifications
You must be signed in to change notification settings - Fork 241
FR: Make URL rewriting of SSR AMP component optional #515
Description
Feature Request
The ampUrlPrefix option for ampOptimizer.transformHtml supports rewriting all cdn.ampproject.org references to your own host. Some AMP components are actually server-side rendered, though. For example, if you fetch https://cdn.ampproject.org/v0/amp-geo-0.1.js in Spain, you get a different file than in the USA (easy to test with a VPN). Some "self-hosters" may not have the capability to do geolocation and determine what needs to update in server-side rendered JS.
It would be great if a new option could be introduced for transformHtml:
rewriteSsrAmpUrls that defaults to true, but could be set to false to preserve script URLs like https://cdn.ampproject.org/v0/amp-geo-0.1.js in the AMP document.
As far as I know amp-geo is the only component where SSR is used today. Having this option available would be beneficial to self-hosters who may not be able to keep up with the introduction of new SSR AMP components.