Ajax Benefits

  • Single page Application
  • Send and Get response without a Browser Reload

Working

  • Adding hash (#!) towards the end of the URL
  • Anything after #! is considered to change the page content.
  • Browser able to navigate between forward and backward using the hash (#)
  • Example : Twitter used #! before

Ajax Canonical Tag

Use

Don’t use

XML Sitemap Creation

  • While creating a sitemap , make sure all the Ajax URL’s with #! are included

Where to use #! hashbang in Ajax page

Anything that user sees

  • All Hyperlinks
  • Sitemap
  • Redirects
  • …etc

Caution : Do not use : _escaped_fragment_ in the URL, where the user could see.

robots.txt to block a hash fragment

  • Considering this is the fragment to block : #DONOTCRAWLthefragment

Using Headless Browser?

Example Browser : htmlunit

  • It needs to have a wait time for it to get the response so you could try waitForBackgroundJavaScript, waitForBackgroundJavaScriptStartingBefore
  • and there are few alternatives like NicelyResynchronizingAjaxController

Coding Alternatives

You could use pubshState() to change the URL without #! and it will look like a normal URL .