用了react 或者 vue,如何做SEO优化呢?

作者:jcmp      发布时间:2021-04-10      浏览量:0
本身给用户一套view,跟蜘蛛另外一套v

本身给用户一套view,跟蜘蛛另外一套view是不算错误的, 错误的是有关键词堆砌、文本语义前后不搭、link farm等等众多特征。判作弊一门综合性的算法,会参考很多要素,最后给出判断。

我一直在用prerender的方案, 然后又自己写了一套性能高的。

https://github.com/zuoyanart/sparender ​ github.com。

1、,

基本原理: 服务端对请求的 user-agent 进行判断,浏览器端直接给 SPA 页面,如果是爬虫,给经过动态渲染的 html 页面(因为蜘蛛不会造成DDOS,所以这种方案相对于SSR能节省不少服务器资源)。

而关于是否作弊,google官方本身就有说法:

https://developers.google.com/search/docs/guides/dynamic-rendering ​ developers.google.com。

Dynamic rendering is not cloaking Googlebot generally doesn't consider dynamic rendering as cloaking. As long as your dynamic rendering produces similar content, Googlebot won't view dynamic rendering as cloaking. When you're setting up dynamic rendering, your site may produce error pages. Googlebot doesn't consider these error pages as cloaking and treats the error as any other error page. Using dynamic rendering to serve completely different content to users and crawlers can be considered cloaking. For example, a website that serves a page about cats to users and a page about dogs to crawlers can be considered cloaking.

如果我们没有刻意去作弊,而是使用动态渲染方案去解决SEO问题,爬虫经过对比网站内容,没有明显差异,不会认为这是作弊行为。