top | item 10347770

(no title)

antichaos | 10 years ago

According to the spec, AMP developers are prohibited from adding their own JS, yet they are mandated to include a <script src="https://cdn.ampproject.org/v0.js" async></script> tag as the last element in the <head>. I find it amusing that the JavaScript library itself is 137KB big (38KB gzipped).

discuss

order

callahad|10 years ago

<img> and <video> are also prohibited in favor of mandatory custom elements like <amp-img> and <amp-video>.

...and vendor-specific tags like <amp-youtube>, <amp-twitter>, and <amp-instagram>, the library of which is controlled by a single gatekeeper.

There must be less invasive ways of achieving the same goal.

51Cards|10 years ago

However like any CDN content, the goal would be for it to be cached if it's in common use across AMP sites. One JS module that covers a large number of content delivery sites seems like a plus to me. I can't vouch for the whole concept yet though, still reading through their spec.

cramforce|10 years ago

Also: We can use a Service Worker for reliable caching of the JS.