5 ms·
It's not difficult to set up middleware that'll render the page for any clients that require it. (For instance, we can assume any client that identifies as "bot
by iLoch 12y ago
It's not difficult to set up middleware that'll render the page for any clients that require it. (For instance, we can assume any client that identifies as "bot" that's not Google probably wants a pre-rendered page, which we can do quite effortlessly. Here's one implementation for Nodejs: https://prerender.io https://prerender.io, or you can always roll your own with something like Phantom.js.
- BorisMelnik 12y agowow this is amazing. would love to see an offshoot of this where it could render a sitemap, or even keep a live sitemap up to date via cron.d or something (just hoping out loud)
- MichaelGG 12y agoWe're using Brombone. You give them your sitemap, they do the prerendering and save it all. Then you proxy to them for Googlebot and others.
- CMCDragonkai 12y agoDynamic constructions of sitemaps is surprisingly difficult. We would need to poll every single page you have, just to check if you potentially have a new link to a new page in your site. And everytime you add a new page, that's a whole another page to scrape and analyse.
- gildas 12y agoYou can use SEO4Ajax [1] to crawl your SPA and generate an up to date sitemap dynamically. [1] http://www.seo4ajax.com/ http://www.seo4ajax.com/
- Touche 12y agoNote that sending a different response to googlebot than what you send to normal users is a violation of Google's guidelines and can get your site penalized. Use at your own peril.
- CMCDragonkai 12y agoNot necessarily. This concept of HTML snapshots is actually suggested by Google as a solution. See this: https://developers.google.com/webmasters/ajax-crawling/docs/html-snapshot https://developers.google.com/webmasters/ajax-crawling/docs/... We comply with Google's guidelines thing (https://snapsearch.io/documentation https://snapsearch.io/documentation)
- Touche 12y agoNo where in that article does it say it's ok to only serve the snapshot to googlebot. Serving different content to googlebot than what you serve to users is called cloaking and is against their guidelines: https://support.google.com/webmasters/answer/66355 https://support.google.com/webmasters/answer/66355 I've invested a significant amount of time in this topic and would love if you were right, but I've never seen the money quote that it's ok to do this. In fact, everything I've read says that you have to treat search bots the same as you treat normal users.
- CMCDragonkai 12y agoThe title of the article says "How do I create an HTML snapshot?" The FAQ (https://developers.google.com/webmasters/ajax-crawling/docs/faq https://developers.google.com/webmasters/ajax-crawling/docs/...) goes into more detail regarding the concept of _escaped_fragment_ which is used in so that your server can respond with a static snapshot instead of javascript. Look at the diagram at the bottom of this page (https://developers.google.com/webmasters/ajax-crawling/docs/learn-more https://developers.google.com/webmasters/ajax-crawling/docs/...) It explicitly says "snapshots"