Does Google not cache my AJAX Crawlable app correctly?

I wrote SPA using durandal 2.0 and im using pushstate for HTML5 for my navigation changes. I have configured everything according to googles specifications. I do not include hashabangs / #! in my urls i use the meta tag instead.

<meta name="fragment" content="!"> 

I use a mute browser, phantom JS, to serve the google bot for the fully displayable HTML of my AJAX application. In MVC, do I discover? _escaped_fragment_ = and redirects 302 to a URL that serves fully rendered HTML. This part is working fine to check this out, go here: https://insureflo.com/?_escaped_fragment_= and you will see the redirect and fully displayed HTML content of my site https://insureflo.com .

I have a site map that has all my URLs, including the root. Despite all this, google will still not cache or crawl my application properly and still show the download page for the application. I got the impression that you can use pushstate and rely on the meta tag meta tag for Google analysis and automatically include escaped_fragment in the URL.

However, getting as googlebot in webmaster tools, I get the following answer:

  HTTP/1.1 302 Found Cache-Control: private Content-Type: text/html; charset=utf-8 Location: /HtmlSnapshot?url=https%3A%2F%2Finsureflo.com%2F%23 Server: Microsoft-IIS/8.0 X-AspNetMvc-Version: 4.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Sun, 08 Sep 2013 06:59:28 GMT Connection: close Content-Length: 168 <html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="/HtmlSnapshot?url=https%3A%2F%2Finsureflo.com%2F%23">here</a>.</h2> </body></html> 

This 302 is correct, I believe, according to the specifications, but why does it not index the redirected content and display it both in the HTMl view and in the preview image on the site? In addition, when viewing the cache in googles search results, I get a blank page and look at the source text displayed on a regular page, and not the full HTML displayed as expected. For instance:

http://webcache.googleusercontent.com/search?q=cache:https://insureflo.com

At that moment, I read and read the specifications, and I believe that I have met the requirements to bypass the AJAX application and really could use some help to figure this out. Am I missing something? Thanks!

+6
source share
2 answers

There are several things that I discovered while trying to do the same.

  • Checking out Google’s Webmaster Tools will tell you that there is a redirect, but it won’t follow it.

  • In order for Google Bot to actually redirect during a crawl, you must have a website that is also redirected to webmaster tools.

  • If you want Google to crawl your site from the sitemap and execute _escaped_fragment_, then the links in your Sitemap should be in the format:

    http://yourlink.com/#!/stuff

I have a more detailed blog entry on my

http://mark.stratmann.me/articles/the-great-ajax-seo-saga

+1
source

I managed to get the site to display correctly inside fetch like google today. In case someone else encounters this, google does not like to be redirected more than once, so when you find the escaped_fragment_ request line, in MVC in my case you need to display the content directly on this page, redirecting to the HTML snapshot page with Using 302 can cause problems in my experience. That way, I just detect this directly in the main controller method and render the contents of the snapshot if I detect a query string. Hope this helps someone else.

Another point is to make sure that the meta fragment is not in your HTML snapshot, I made this mistake already.

0
source

Source: https://habr.com/ru/post/953534/


All Articles