Should I use pushState to update my URLs instead of #! to manage Ajax navigation?
Why Webmasters Stack Exchange recommends it
Webmasters Stack Exchange answerers cite it as Google's own statement that pushState sites are crawlable and that clean History API URLs are preferred over #! URLs.
Recommended by 0 people across 0 different months, 2013 to 2017.
Why Stack Overflow recommends it
Stack Overflow users link it as Google's own word that pushState URLs are crawlable and preferred over hashbang URLs in single-page apps.
Recommended by 0 people across 0 different months, 2014 to 2014.
What it is
A 50-second Google Webmaster Help answer to a question from Paul Irish about whether to use the HTML5 history pushState API instead of hashbang (#!) URLs for Ajax navigation. It is a short official statement from Google about how its crawler treats these URL styles.
What people said
Cites Stephen Ostermiller · 2013-03 · Webmasters Stack Exchange · on “Do other search engines support Google's "hash bang" syntax for crawling AJAX applications?”
As of 2018, Google no longer supports special crawling for hash bang AJAX [LINK] . I would choose to use push state rather than hash bang AJAX URLs now. Google's Matt Cutts just said this about push state [this video] : A correcly implemented site that uses push state typically doesn't need any extra support enabled for us to crawl it. It should be much easier for other crawlers that might not support hash bang to deal with a push state site. According to a web page that no longer exists, Bing does now support hash bang crawling. I haven't been able to find information about the meta fragment support for either Bing or Yahoo. My guess is that if they did support it at some point, they have also s
Cites DisgruntledGoat · 2013-11 · Webmasters Stack Exchange · on “When Googlebot sees a link, will it click it or navigate to it?”
While Googlebot understands and parses some JavaScript, it doesn't run like your graphical web browser does. It makes a request to a URL (e.g. your home page) and the server sends back HTML. If your site returns no true HTML (e.g. little more than just a script tag) then you may have problems with Google or other search engines crawling your pages. However according to this video [this video] , Googlebot does understand pushState. So it appears that it will use the AJAX method rather than making separate requests for pages. That means it would show the correct URL in search results. That's not to say you should forget about that - making a separate request should always return the proper page as
Cites Stephen Ostermiller · 2013-11 · Webmasters Stack Exchange · on “When Googlebot sees a link, will it click it or navigate to it?”
Google's Matt Cutts answered your question in a video [this video] : A correctly implemented site that uses pushstate typically doesn't need any extra support for us to be able to crawl it. This is because Googlebot will always follow the links that are in your page whether or not there is JavaScript that intercepts them. So it will get the pre-rendered versions of the pages and direct users to those URLs. Googlebot may also try to parse some of your JavaScript and fetch URLs that it finds there. So you may see Googlebot also fetching some of the page fragments that you serve as push state.
Cites fregante · 2013-12 · Webmasters Stack Exchange · on “Using Ajax #! for Google but site is not being crawled any more”
Even though hashbangs [LINK] #! are still supported, Google suggests [this video] steering away from using them and just use the History API [LINK] to change the URL. Libraries like History.js [LINK] make it easy to do so. This basically removes your problem altogether, there's no need to set up urls with _escaped_fragment_ when using the History API
Cites Stephen Ostermiller · 2013-12 · Webmasters Stack Exchange · on “Serve different content for web crawlers to fix SEO for SPA?”
Serving different content to search engine spiders is known as "cloaking" and it is specifically against the webmaster guidelines published by the search engines [LINK] : Some examples of cloaking include: Serving a page of HTML text to search engines, while showing a page of images or Flash to users Google does recommend that if your site is heavily JavaScript dependent you can use the tag [LINK] : Place the same content from the JavaScript in a <noscript> tag. If you use this method, ensure the contents are exactly the same as what’s contained in the JavaScript, and that this content is shown to visitors who do not have JavaScript enabled in their browser. EDIT: as of 2018 the crawlable AJ
Cites twiz · 2014-03 · Stack Overflow · on “Hashbang URLs using Ember.js”
Just in case anyone was unaware, Google can also crawl sites that use HTML5 pushState rather than the hash-bang method. Here it is from the horse's mouth: [this video] Here is the Ember doc on using it: [LINK]
Cites superluminary · 2014-04 · Stack Overflow · on “How do search engines deal with AngularJS applications?”
(2022) Use Server Side Rendering if possible, and generate URLs with Pushstate Google can and will run JavaScript now so it is very possible to build a site using only JavaScript provided you create a sensible URL structure. However, pagespeed has become a progressively more important ranking factor and typically pages built clientside perform poorly on initial render. Serverside rendering (SSR) can help by allowing your pages to be pre-generated on the server. Your html containst the div that will be used as the page root, but this is not an empty div, it contains the html that the JavaScript would have generated if it were allowed to run. The client downloads the HTML and renders it giving
Cites Hello World · 2014-12 · Stack Overflow · on “is Pushstate inferior to Hashbangs when it comes to caching?”
There are several advantages to the HTML5 Pushstate in comparison to hasbangs, in fact, Google is now encouraging the use of Pushstate [this video] . The only Pushstate disadvantage being publicly discussed is the fact that non-modern browsers do not support it. However, to me it seems that Pushstate is also disadvantageous when it comes to caching. I might be wrong, hence this question. is Pushstate inferior to Hashbangs when it comes to caching pages? Here is a case where it seems that Pushstate is bad at caching. Pushsate Bob navigates to eg.com/page1 , the full page is downloaded, rendered and cached. Bob clicks a button, eg.com/json/page2 is downloaded and cached. The browser Processes the J
Cites Goyllo · 2017-07 · Webmasters Stack Exchange · on “Does Hashtag in the URL affect SEO rankings for as Angular JS web application”
Google just don't understand what the meaning of /#!/ or any other thing like /10787/ in this question URL, but they can crawl the hashbang [this video] /#!/ URL just like other URL's. I suggest to go for clean URL's, if it take only few hours to setup, it will impress your visitors as well. The keyword in URL affect very very small in ranking [LINK] , but the position of keyword like after /#!/ or /10787/ or after 3 sub directory does not make much difference. [LINK]