{"id":24232,"date":"2009-10-07T00:00:00","date_gmt":"2009-10-07T00:00:00","guid":{"rendered":"https:\/\/alienroad.com\/google-bilgi-bankasi\/a-proposal-for-making-ajax-crawlable\/"},"modified":"2009-10-07T00:00:00","modified_gmt":"2009-10-07T00:00:00","slug":"a-proposal-for-making-ajax-crawlable","status":"publish","type":"ar_kb","link":"https:\/\/alienroad.com\/google-bilgi-bankasi\/a-proposal-for-making-ajax-crawlable\/","title":{"rendered":"A proposal for making AJAX crawlable"},"content":{"rendered":"<aside class=\"key-point\">It&#8217;s been a while since we published this blog post. Some of the information may be outdated (for example, some images may be missing, and some links may not work anymore).<\/aside>\n<p class=\"gargardate\">Wednesday, October 07, 2009<\/p>\n<p>\n  Today we&#8217;re excited to propose a new standard for making AJAX-based websites crawlable. This will<br \/>\n  benefit webmasters and users by making content from rich and interactive AJAX-based websites<br \/>\n  universally accessible through search results on any search engine that chooses to take part. We<br \/>\n  believe that making this content available for crawling and indexing could significantly improve<br \/>\n  the web.\n<\/p>\n<p>\n  While AJAX-based websites are popular with users, search engines traditionally are not able to<br \/>\n  access any of the content on them. The last time we checked, almost 70% of the websites we know<br \/>\n  about use JavaScript in some form or another. Of course, most of that JavaScript is not AJAX, but<br \/>\n  the better that search engines could crawl and index AJAX, the more that developers could add<br \/>\n  richer features to their websites and still show up in search engines.\n<\/p>\n<p>Some of the goals that we wanted to achieve with this proposal were:<\/p>\n<ul>\n<li>Minimal changes are required as the website grows<\/li>\n<li>Users and search engines see the same content (no cloaking)<\/li>\n<li>Search engines can send users directly to the AJAX URL (not to a static copy)<\/li>\n<li>\n    Site owners have a way of verifying that their AJAX website is rendered correctly and thus that<br \/>\n    the crawler has access to all the content\n  <\/li>\n<\/ul>\n<p>Here&#8217;s how search engines would crawl and index AJAX in our initial proposal:<\/p>\n<ul>\n<li>\n    <b>Slightly modify the URL fragments for stateful AJAX pages<\/b><br \/>\n    Stateful AJAX pages display the same content whenever accessed directly. These are pages that<br \/>\n    could be referred to in search results. Instead of a URL like<br \/>\n    <code>https:\/\/example.com\/page?query#state<\/code><br \/>\n    we would like to propose adding a token to make it possible to recognize these URLs:<br \/>\n    <code>https:\/\/example.com\/page?query#[FRAGMENTTOKEN]state<\/code>. Based on a review of current<br \/>\n    URLs on the web, we propose using &#8220;!&#8221; (an exclamation point) as the token for this. The proposed<br \/>\n    URL that could be shown in search results would then be:<br \/>\n    <code>https:\/\/example.com\/page?query#!state<\/code>.\n  <\/li>\n<li>\n    <b>Use a headless browser that outputs an HTML snapshot on your web server<\/b><br \/>\n    The headless browser is used to access the AJAX page and generates HTML code based on the final<br \/>\n    state in the browser. Only specially tagged URLs are passed to the headless browser for<br \/>\n    processing. By doing this on the server side, the website owner is in control of the HTML code<br \/>\n    that is generated and can easily verify that all JavaScript is executed correctly. An example of<br \/>\n    such a browser is<br \/>\n    <a href=\"https:\/\/htmlunit.sourceforge.net\/\" class=\"external-link\">HtmlUnit<\/a>,<br \/>\n    an open-sourced &#8220;GUI-less browser for Java programs.\n  <\/li>\n<li>\n    <b>Allow search engine crawlers to access these URLs by escaping the state<\/b><br \/>\n    As URL fragments are never sent with requests to servers, it&#8217;s necessary to slightly modify the<br \/>\n    URL used to access the page. At the same time, this tells the server to use the headless browser<br \/>\n    to generate HTML code instead of returning a page with JavaScript. Other, existing URLs &#8211; such<br \/>\n    as those used by the user &#8211; would be processed normally, bypassing the headless browser. We<br \/>\n    propose escaping the state information and adding it to the query parameters with a token.<br \/>\n    Using the previous example, one such URL would be<br \/>\n    <code>https:\/\/example.com\/page?query&amp;[QUERYTOKEN]=state<\/code>. Based on our analysis of<br \/>\n    current URLs on the web, we propose using <code>_escaped_fragment_<\/code> as the token. The<br \/>\n    proposed URL would then become<br \/>\n    <code>https:\/\/example.com\/page?query&amp;_escaped_fragment_=state<\/code>.\n  <\/li>\n<li>\n    <b>Show the original URL to users in the search results<\/b><br \/>\n    To improve the user experience, it makes sense to refer users directly to the AJAX-based pages.<br \/>\n    This can be achieved by showing the original URL (such as<br \/>\n    <code>https:\/\/example.com\/page?query#!state<\/code> from our example above) in the search results.<br \/>\n    Search engines can check that the indexable text returned to Googlebot is the same or a subset<br \/>\n    of the text that is returned to users.\n  <\/li>\n<\/ul>\n<p><img decoding=\"async\" alt=\"diagram of an http request with ajax crawl setup\" src=\"https:\/\/alienroad.com\/wp-content\/uploads\/kb-gorsel\/g-7dd9d279b1b2.png\" loading=\"lazy\"><\/p>\n<p>\n  In summary, starting with a stateful URL such as<br \/>\n  <code>https:\/\/example.com\/dictionary.html#AJAX<\/code>, it could be available to both crawlers and<br \/>\n  users as <code>https:\/\/example.com\/dictionary.html#!AJAX<\/code> which could be crawled as<br \/>\n  <code>https:\/\/example.com\/dictionary.html?_escaped_fragment_=AJAX<\/code> which in turn would be<br \/>\n  shown to users and accessed as <code>https:\/\/example.com\/dictionary.html#!AJAX<\/code>\n<\/p>\n<aside class=\"note\">\n  We used to have a presentation embedded in this article, but it&#8217;s lost now (the internet ate our<br \/>\n  homework?).<br \/>\n<\/aside>\n<p>\n  <a href=\"https:\/\/docs.google.com\/present\/view?id=dc75gmks_120cjkt2chf\" class=\"external-link\">View the presentation<\/a>\n<\/p>\n<p>\n  We&#8217;re currently working on a proposal and a prototype implementation. Feedback is very<br \/>\n  welcome&mdash;please add your comments below or in our<br \/>\n  <a href=\"https:\/\/support.google.com\/webmasters\/community\/thread?tid=01242a2a9bafd648\" class=\"external-link\">Webmaster Help Forum<\/a>.<br \/>\n  Thank you for your interest in making the AJAX-based web accessible and useful through search<br \/>\n  engines!\n<\/p>\n<p class=\"byline-author\">\n  Proposal by Katharina Probst, Bruce Johnson, Arup Mukherjee, Erik van der Poel and Li Xiao, Google<\/p>\n<p>  Blog post by<br \/>\n  <a class=\"external-link\" href=\"https:\/\/twitter.com\/JohnMu\" class=\"external-link\">John Mueller<\/a>,<br \/>\n  Webmaster Trends Analyst, Google Z\u00fcrich<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been a while since we published this blog post. Some of the information may be outdated (for example, some images may be missing, and some links may not work anymore). Wednesday, October 07, 2009 Today we&#8217;re excited to propose a new standard for making AJAX-based websites crawlable. This will benefit webmasters and users by [&hellip;]<\/p>\n","protected":false},"menu_order":85476,"template":"","meta":{"footnotes":""},"ar_kb_kategori":[665],"ar_kb_etiket":[],"class_list":["post-24232","ar_kb","type-ar_kb","status-publish","has-post-thumbnail","hentry","ar_kb_kategori-blog"],"_links":{"self":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/24232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb"}],"about":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/types\/ar_kb"}],"version-history":[{"count":0,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/24232\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media\/26741"}],"wp:attachment":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media?parent=24232"}],"wp:term":[{"taxonomy":"ar_kb_kategori","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_kategori?post=24232"},{"taxonomy":"ar_kb_etiket","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_etiket?post=24232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}