官术网_书友最值得收藏!

Optimizations that make AMP fast

  • JavaScript: All JavaScript is loaded asynchronously and is non-blocking. No user JavaScript is allowed in the main page (although you can include JavaScript in iframes that can't block the main page render).
  • Static resource sizing: External resources such as images, videos, and ads must specify their sizes statically. This means that AMP can calculate the position of all elements and page layout before anything is downloaded.
  • CSS inlining and limitations: CSS must be inlined in the head of the AMP page and is limited to 50 KB per page. Some CSS is restricted, including the * selector, the not selector, the filter property, and the !important declaration. Only GPU-accelerated CSS animations and transitions are permitted. If the GPU can't handle an effect, then the browser must perform the required computation instead, slowing down the page render. Specifically, only transform and opacity properties can be animated.
  • Web fonts: Web fonts can only be loaded from white-listed providers.
  • Optimized resource loading: AMP takes control of resource downloading from the browser. Only items that are above-the-fold, or that are likely to be seen by the user, are fetched.
  • Efficient pre-rendering: When possible, AMP pages are pre-rendered in the background. This is where things get really interesting!
主站蜘蛛池模板: 唐山市| 溧阳市| 绥棱县| 永仁县| 临猗县| 西贡区| 商河县| 法库县| 隆德县| 马鞍山市| 尼勒克县| 神农架林区| 新巴尔虎右旗| 金沙县| 台中县| 湾仔区| 霍城县| 宜兰县| 锦州市| 澳门| 盈江县| 襄汾县| 维西| 凤台县| 安仁县| 黄浦区| 清原| 织金县| 永春县| 右玉县| 酒泉市| 红原县| 南康市| 清原| 徐闻县| 舒兰市| 西充县| 雷山县| 靖宇县| 绵竹市| 瓦房店市|