我们将弃用 AJAX 抓取方案
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
2015年12月17日星期四
要点:我们不再建议网站站长遵循我们于
2009 年
提出的
AJAX 抓取方案
。
我们于 2009 年提出了
关于如何使 AJAX 页面可抓取的方案
。当时,我们的系统无法呈现和解读使用 JavaScript 向用户提供内容的页面。鉴于“
抓取工具…[当时] 无法看到任何动态创建的内容
”,我们提出了一套建议的做法,网站站长可以遵循这些做法,以确保采用 AJAX 的应用能够被搜索引擎编入索引。
时代变了。现在,只要您没有禁止 Googlebot 抓取您的 JavaScript 文件或 CSS 文件,我们通常都能够
像新型浏览器那样呈现和解读您的网页
。为了体现这一改进,我们最近更新了
网站站长技术指南
,其中建议网站站长不要禁止 Googlebot 抓取网站的 CSS 文件或 JS 文件。
我们于 2009 年提出的方案所基于的假设已不再符合现实情况,因此,现在我们建议遵循
渐进增强
原则。例如,您可以使用
History API pushState()
来确保更多的浏览器(及我们的系统)能够访问您的页面。
问答部分
问:我的网站目前遵循的是你们之前的建议,并且支持 _escaped_fragment_。现在你们已弃用这些建议,搜索引擎会因此而不再将我的网站编入索引吗?
答:不会,您的网站仍会被编入索引。但总的来说,我们建议您在下次更新网站时改为遵循业界最佳做法。通常情况下,我们抓取、呈现并编入索引的是 #! 网址,而不是 _escaped_fragment_ 网址。
问:弃用 AJAX 抓取方案并改为遵循业界最佳做法会被视为网站迁移吗?是否需要实现重定向?
答:如果当前的设置能够正常发挥作用,那么您就不必立即进行任何更改。如果您要构建新的网站或要调整现有网站的结构,只需避免使用 _escaped_fragment_ 网址即可。
问:我使用 JavaScript 框架,并且我的网站服务器会提供预呈现的页面。这种做法仍然可行吗?
答:总的来说,网站不应仅针对 Google 预呈现页面 - 您可能需要预呈现页面,以便为用户提供更好的体验,在这种情况下,您应遵循渐进增强指南。如果您要预呈现页面,请确保向 Googlebot 提供的内容和用户看到的内容完全一致(无论是在外观方面,还是在互动方式方面)。如果向 Googlebot 提供的内容和普通用户看到的内容不一样,会被视为隐藏真实内容,这种行为违反了我们的网站站长指南。
如果您有任何疑问,请随时在此处或
网站站长帮助论坛
中发帖咨询。
发布者:
萩原永山(Kazushi Nagayama)
,搜索质量分析师
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2015-12-01。
[null,null,["最后更新时间 (UTC):2015-12-01。"],[[["\u003cp\u003eGoogle is retracting its 2009 recommendation for AJAX crawling using \u003ccode\u003e_escaped_fragment_\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eGooglebot can now render and understand web pages like modern browsers, including JavaScript and CSS, making the previous AJAX crawling proposal obsolete.\u003c/p\u003e\n"],["\u003cp\u003eWebsites are encouraged to adopt progressive enhancement principles, ensuring content accessibility for a wider range of browsers and search engines.\u003c/p\u003e\n"],["\u003cp\u003eWhile websites using \u003ccode\u003e_escaped_fragment_\u003c/code\u003e will still be indexed, Google recommends implementing industry best practices, like using \u003ccode\u003e#!\u003c/code\u003e URLs or History API's \u003ccode\u003epushState()\u003c/code\u003e, for new or restructured websites.\u003c/p\u003e\n"],["\u003cp\u003ePre-rendering pages for performance benefits is acceptable, but the content served to Googlebot must match the user's experience to avoid cloaking.\u003c/p\u003e\n"]]],["Google is no longer recommending the 2009 AJAX crawling proposal. Google's systems can now render and understand JavaScript-driven content, similar to modern browsers, provided Googlebot isn't blocked from accessing JavaScript or CSS files. Sites using the old `_escaped_fragment_` method will still be indexed, but new implementations should avoid it. Instead, use progressive enhancement principles and ensure the content served to Googlebot matches the user experience. Pre-rendering for general user benefits is acceptable, but cloaking is not.\n"],null,["# Deprecating our AJAX crawling scheme\n\nWednesday, October 14, 2015\n\n\nIn short: We are no longer recommending the [AJAX crawling](/search/docs/ajax-crawling)\nproposal we made\n[back in 2009](/search/blog/2009/10/proposal-for-making-ajax-crawlable).\n\n\nIn 2009, we made a\n[proposal to make AJAX pages crawlable](/search/blog/2009/10/proposal-for-making-ajax-crawlable).\nBack then, our systems were not able to render and understand pages that use JavaScript to present\ncontent to users. Because\n\"[crawlers are not able to see any content created dynamically](/search/docs/ajax-crawling/learn-more)\",\nwe proposed a set of practices that webmasters can follow in order to ensure that their AJAX-based\napplications are indexed by search engines.\n\n\nTimes have changed. Today, as long as you're not blocking Googlebot from crawling your JavaScript\nor CSS files, we are generally able to\n[render and understand your web pages like modern browsers](/search/blog/2014/05/understanding-web-pages-better).\nTo reflect this improvement, we recently\n[updated our technical Webmaster Guidelines](/search/blog/2014/10/updating-our-technical-webmaster)\nto recommend against disallowing Googlebot from crawling your site's CSS or JS files.\n\n\nSince the assumptions for our 2009 proposal are no longer valid, we recommend following the\nprinciples of\n[progressive enhancement](https://en.wikipedia.org/wiki/Progressive_enhancement).\nFor example, you can use the\n[`History API pushState()`](https://developer.mozilla.org/en-US/docs/Web/API/History_API)\nto ensure accessibility for a wider range of browsers (and our systems).\n\nQuestions and answers\n---------------------\n\n\n**Q: My site currently follows your recommendation and supports `_escaped_fragment_`.\nWould my site stop getting indexed now that you've deprecated your recommendation?** \n\nA: No, the site would still be indexed. In general, however, we recommend you implement industry\nbest practices when you're making the next update for your site. Instead of the\n`_escaped_fragment_` URLs, we'll generally crawl, render, and index the\n`#!` URLs.\n\n\n**Q: Is moving away from the AJAX crawling proposal to industry best practices considered a site\nmove? Do I need to implement redirects?** \n\nA: If your current setup is working fine, you should not have to immediately change anything. If\nyou're building a new site or restructuring an already existing site, simply avoid introducing\n`_escaped_fragment_` urls.\n\n\n**Q: I use a JavaScript framework and my webserver serves a pre-rendered page. Is that still\nok?** \n\nA: In general, websites shouldn't pre-render pages only for Google---we expect that you might\npre-render pages for performance benefits for users and that you would follow progressive\nenhancement guidelines. If you pre-render pages, make sure that the content served to Googlebot\nmatches the user's experience, both how it looks and how it interacts. Serving Googlebot different\ncontent than a normal user would see is considered cloaking, and would be against our Webmaster\nGuidelines.\n\n\nIf you have any questions, you can post them here, or\n[in the webmaster help forum](https://support.google.com/webmasters/go/community).\n\n\nPosted by\n[Kazushi Nagayama](https://plus.google.com/+KazushiNagayama/), Search\nQuality Analyst"]]