googlebot 所需的 HTML 快照是否需要设置样式
为了使 ajax 网站可以被 googlebot 抓取,它要求您的网站在设置了 _escaped_fragment 变量的页面时发回 HTML 快照。 (有关详细信息,请参阅此处)
此 HTML 快照是否需要正确设置样式,即 googlebot 是否需要正确设置样式使用快照预览您的网站(如您在搜索结果页面上看到的那样)。我问,因为我的一些页面使用 javascript 来正确地动态调整图像大小,因为这不能在 CSS 中完成。
谢谢
To make an ajax site web crawlable by googlebot, it requries that your website send back a HTML snapshot when a page with the _escaped_fragment variable set. (for more info see here)
Does this HTML snapshot need to be styled correctly, i.e. does googlebot use the snapshot to give a preview of your site (as you see on the search results page). I ask as some of my pages use javascript to correctly resize images dynamically as this cant by done in the CSS.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您需要在客户端呈现页面时拍摄页面快照,那么使用 Java 或 php 等无头浏览器(例如 HtmlUnit)生成这些快照可能是有意义的。如果可行的话,尝试将图像处理转移到服务器端可能会减少工作量。
虽然您的快照不太可能被用作预览(我检查的所有 #! 爬网站点都表示“没有可用的预览”),但如果您的快照和所提供的服务存在差异,那么从技术上讲,它可以被视为“隐藏”页。我怀疑 Google 会因为一些 CSS 差异而生气,但值得注意。
If you need to take a snapshot of the page as it is rendered on the client side, then it might make sense to generate these snapshots with a headless browser such as HtmlUnit if you are using Java or php. It may be less work to try and move your image processing to the server side if feasible.
While it is unlikely that your snapshots will be used as a preview (all the #! crawled sites I checked all said "No preview available"), it could technically be considered "cloaking" if you have differences in your snapshot and in your served page. I doubt Google would get mad over a few CSS differences but it is worth noting.