Should AMP-HTML pages download the JavaScript library from ampproject.org?

The documentation states that AMP HTML documents MUST

  • It contains the <script async src="https://cdn.ampproject.org/v0.js"></script> as the last element in the head (this includes and loads the AMP JS library).

Does this mean that I can’t maintain an internal copy of this file (for example, for use in a limited network environment without Internet access)?

+6
source share
1 answer

To be a valid AMP document, you must use the <script async src="https://cdn.ampproject.org/v0.js"></script> .

However, in the current AMP document, you can also specify a canonical URL. Typically, a canonical URL is an HTML document that uses services that are not allowed by the AMP architecture (e.g. custom JavaScript, such as Bootstrap JS for menus). You can also assign an AMP document to a canonical tag, and then serve it to people who do not have unlimited access to the Internet (and therefore to Google’s CDN).

0
source

All Articles