Frontend Development 14 min read

Accelerated Mobile Pages (AMP): Overview, Components, and Performance Optimization

Accelerated Mobile Pages (AMP) is Google’s open‑source framework that enforces HTML restrictions, uses custom amp‑ components and a priority‑based JavaScript engine, caches validated pages, and applies strict loading, CSS, and animation rules to dramatically speed up static mobile content, improving SEO and user experience despite some development overhead.

Tencent Music Tech Team
Tencent Music Tech Team
Tencent Music Tech Team
Accelerated Mobile Pages (AMP): Overview, Components, and Performance Optimization

Statistics show that 40% of users abandon websites that take more than 3 seconds to load. To address slow page loads, Google launched the Accelerated Mobile Pages (AMP) project together with many technology companies.

AMP is an open‑source initiative by Google aimed at dramatically reducing the rendering time of static content on mobile devices. In tests on a simulated Nexus 5 with 3G, AMP can improve first‑paint speed by 15%‑85%.

1. What is AMP?

AMP stands for Accelerated Mobile Pages. It is a set of restrictions and custom components built on top of standard HTML to ensure fast loading.

2. AMP HTML

AMP HTML adds usage limits to normal HTML and introduces custom components.

Disabled tags include <frame> , <form> , <input> and others.

Some tags must be replaced with AMP equivalents, e.g., <img> → <amp-img> , <video> → <amp-video> .

Additional AMP components such as <amp-carousel> , <amp-iframe> , <amp-youtube> are available, but they require the corresponding JS file to be imported.

A simple AMP HTML example must follow these rules:

DTD: <!doctype html>

Root tag: <html amp>

Canonical link in <head> : <link rel="canonical" href="$SOME_URL" />

Charset meta at the very beginning of <head> : <meta charset="utf-8">

Viewport meta: <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">

AMP runtime script as the last element in <head> : <script async src="https://cdn.ampproject.org/v0.js"></script>

Boilerplate style and <noscript> blocks as shown in the official docs.

2. AMP HTML Components

Custom components (5): amp-ad , amp-embed , amp-img , amp-pixel , amp-video .

These are used as regular HTML tags, e.g., amp-video , amp-img , which internally render the native <video> and <img> elements.

Extended components such as amp-ad and amp-embed load third‑party content via iframe .

3. AMP JS

AMP JS is the core engine that coordinates resource loading priorities, ensuring that critical content renders first. It scores resources based on element priority, operation priority, and visibility, then adjusts loading order accordingly.

It also provides performance optimizations like pre‑layout of elements, disabling slow CSS selectors, sandboxing iframes, and a validator that can be triggered by appending #development=1 to the URL.

4. Google AMP Cache

The AMP Cache is a CDN that fetches, caches, and serves validated AMP pages over HTTP/2, delivering HTML, JS, and images from a single origin.

5. AMP vs. Traditional HTML

In a test with identical content (33 HTTP requests, 1 video, 28 images) on a 3G network, the AMP page’s onload time was more than 50% faster than the regular HTML page.

Static‑content pages benefit noticeably, though the test does not cover dynamic data fetching or complex interactions.

6. How AMP Improves Performance (Key Techniques)

Only asynchronous script loading; inline JS is prohibited.

Static resources must declare width and height, allowing layout before download.

Extended components load their own JS without blocking rendering.

Third‑party JS runs inside sandboxed iframes, avoiding main‑thread blockage.

CSS must be inline and limited to 50 KB, reducing HTTP requests.

Web fonts are loaded only after critical resources, preventing render‑blocking.

DOM reads are performed before writes to minimize style recalculations.

Only GPU‑accelerated animations (transform, opacity) are allowed.

Resource loading order is optimized; high‑priority assets load first.

Preconnect API is used to establish early connections for critical origins.

7. Summary & Considerations

AMP improves SEO, provides lazy‑loading and on‑demand loading, and is especially effective for content‑heavy pages. Limitations include reliance on CDN resources that may be slow or blocked in some regions, restrictions on third‑party assets, and a strict code‑style guide that can increase development overhead.

AMP is primarily designed for static news‑type sites; its resource‑control strategies can inspire broader mobile‑web optimization.

References:

AMP Project Documentation

AMP Project Overview

AMP Validator Guide

AMP GitHub Repository

Front-endOptimizationweb performanceHTMLmobile webAMP
Tencent Music Tech Team
Written by

Tencent Music Tech Team

Public account of Tencent Music's development team, focusing on technology sharing and communication.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.