Site Performance: rel=canonical vs redirect 301

杀马特。学长 韩版系。学妹 提交于 2019-12-12 06:32:05

问题


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?


回答1:


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.

rel=canonical

  1. User makes a request for /non-canonical.html
  2. Server looks up canonical URL: /canonical.html
  3. Server builds a page that includes the canonical tag and sends it to the user

301 Redirect

  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.


来源:https://stackoverflow.com/questions/15916949/site-performance-rel-canonical-vs-redirect-301

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!