MIP是什么意思,mip怎么用


什么是 MIP

MIP(Mobile Instant Pages – 移动网页加速器),是一套应用于移动网页的开放性技术标准。通过提供 MIP-HTML 规范、MIP-JS 运行环境以及 MIP-Cache 页面缓存系统,实现移动网页加速。

MIP 主要由三部分组织成:

  • MIP-HTML:基于 HTML 中的基础标签制定了全新的规范,通过对一部分基础标签的使用限制或功能扩展,使 HTML 能够展现更加丰富的内容。
  • MIP-JS:可以保证 MIP-HTML 页面的快速渲染。
  • MIP-Cache:用于实现 MIP 页面的高速缓存,从而进一步提高页面性能。

mip怎么用

下面是一段简单的 MIP-HTML 代码示例:

<!DOCTYPE html>
<html mip>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <link rel="stylesheet" type="text/css" href="https://c.mipcdn.com/static/v2/mip.css">
    <link rel="canonical" href="https://www.example.com/your/path.html">
    <!-- noscript 标签是为了在不支持 script 的环境下快速的展现 MIP 页面,推荐使用 -->
    <noscript>
      <style mip-officialrelease>
        body {
          -webkit-animation: none;
             -moz-animation: none;
              -ms-animation: none;
                  animation: none;
        }
      </style>
    </noscript>
  </head>
  <body>
    <h1>Hello World!</h1>
    <script src="https://c.mipcdn.com/static/v2/mip.js"></script>
  </body>
</html>