0
votes

I am building a website that is Ajax based. when Dom is load, an async http request is made to a server which answer a JSON text, then the data from JSON are put in the DOM by javascript. Google crawler just doesn't read content loaded after javscript, so i need to create an HTML snapshot of my page (on the server), and make my server handles requests with hashbang. But my doubt is that i am not using hashbangs in my request. My only ajax req is something like http://www.apiservice.com?get_data=true How can i tell google which request make to get the HTML snapshot of the entire page and where can i do it (maybe putting the request url in sitemap?)

Thank you in advantage

1

1 Answers

0
votes

I understand your page is built in two steps: first request to server getting the core html/javascript, and a second one getting additional data to displayed in your page.

If so, then the first request is the one for the crawler with the hashbang. It makes a lot of sense to put it in your sitemap. The static html page that your server should return is the complete html resulting from the two server calls in your process.

If you do not cache the static html page for the crawler and instead generate it dynamically (e.g., use htmlunit, see this SO reference) then both steps would be executed before returning the static html snapshot. So if you cache it then you ought to make sure you do the same.