本页内容

当PageSpeed Insights检测到您在指定网址转至最终目标网页的过程中使用了多个重定向时,就会触发此规则。

概览

由于重定向会触发额外的HTTP请求响应周期,并会额外延长往返时间延迟,因此,将应用发出的重定向数量降至最低至关重要。避免HTTP重定向可以缩减用户等待网页加载的时间。我们建议您仔细斟酌自己网站的设计,看看可以在哪些方面提升网站性能。

以下是重定向模式的一些优劣示例:

  • 优质:example.com使用响应性网页设计,无需重定向
  • 中等:example.com -> m.example.com/home
  • 劣质:example.com -> www.example.com -> m.example.com -> m.example.com/home

 

建议

按照Google的建议使用响应性网页设计,您的网站自然会避免重定向。

如果您的网站明确要求进行重定向,您必须执行以下两项操作:
  • 使用HTTP重定向将采用移动用户代理的用户直接发送到对等的移动版网址,而不执行任何中间的重定向;并且
  • 在您的桌面版网页中加入<link rel="alternate">标记来识别对等的移动版网址,以便Googlebot能够找到您的移动版网页。

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies.