Search code examples
amp-html

Is it possible to create an AMP page without including v0.js script?


I'd like to make my website AMP friendly to take advantage of the caching. However, the v0.js AMP Javascript library is over 250KB, whereas my webpage is only 7KB including all images, CSS and scripts. I cannot justify adding that much bloat to my site just to take advantage of caching. Is it possible to create an AMP page without including the Javascript library?

The site is simple enough that I do not need to replace any elements with AMP components.


Solution

  • Short answer: no.

    v0.js is essentially the backbone of the AMP framework and without it the AMP cache really does not know what to do with your website. The special tags inside AMP (ie; amp-img, which is part of v0.js) are what allow the cache to easily recognize items something that can be included in the AMP cache. Obviously there are other hurdles involved in creating an AMP valid page, but at the end of the day v0.js is a requirement.

    If your page is already that lightweight you're most likely already quite mobile friendly as far as page size goes and the AMP cache would offer really no further advantage for you.