本文介绍了网站性能:rel = canonical vs redirect 301的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在中,他说 rel = canonical 应该是次要选择,如果您不能使用301重定向。使用301重定向而不是 rel = canonical 是否存在任何性能问题?

From this page on the blog of Matt Cutts, he says that rel=canonical should be a secondary choice if you can't use a 301 redirect. Is there any performance issue with using a 301 redirect instead of a rel=canonical?

推荐答案

以我的经验,性能差异可以忽略不计。 301重定向的实现涉及更多步骤,因此 rel = canonical 的性能可能会稍好一些。额外的步骤通常非常快速地执行,因此不应增加任何明显的延迟或服务器资源负担。

In my experience, the performance difference is negligible. There are more steps involved in the implementation of 301 redirects, so rel=canonical might perform slightly better. The extra steps are typically executed very quickly and should not add any noticeable delay or strain on server resources.


  1. 用户请求/ non-canonical。 html

  2. 服务器查找规范的URL:/canonical.html

  3. 服务器构建一个包含规范标记的页面,并将其发送给用户



301重定向



301 Redirect


  1. 用户提出以下要求/non-canonical.html

  2. 服务器查找规范URL:/canonical.html

  3. 服务器发出301重定向到规范URL。

  4. 用户的浏览器自动向/canonical.html发出第二个请求。
  5. 服务器发现此请求是针对标准URL。

  6. 服务器将建立一个页面并将其发送给用户。

  1. User makes a request for /non-canonical.html
  2. Server looks up canonical URL: /canonical.html
  3. Server issues a 301 redirect to the canonical URL.
  4. User's browser automatically makes a second request for /canonical.html
  5. Server discovers that this request is for a canonical URL.
  6. Server builds a page and sends it to the user.

这篇关于网站性能:rel = canonical vs redirect 301的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 07:57