Does it matter that the JS-constructed HTML does not look anything like the spider-friendly version?
We're about to deploy an AngularJS application that is using PhantomJS to generate the spider-friendly content on the server. I'd much prefer to do this simpler method if it works just as well.
We're building a small-ish site now with Backbone where we do something similar with PhantomJS. In our `grunt build` task, phantomjs saves static versions of subpages. Each of those pages loads up the same backbone app, but the user (and search engine) sees the content they would expect to see no matter where they land – without waiting for Backbone to load and run through it's router. And it didn't take much time to setup.
Progressive enhancement is "The Right Way", for sure, but there are some projects where we just aren't concerned with targeting users without Javascript. That said, hopefully this will let us cater to many of those users, reap the SEO benefits, and provide a better first-landing experience for those not hitting the home page.
Google's spiders prefer you not to try and 'detect' them and serve different content up to them. However, afaik they're fine with this technique (I mean, they even provide a spec to do so). See their content guidelines on 'Hidden text and links' [1]
However, not all hidden text is considered deceptive. For example, if your site includes technologies that search engines have difficulty accessing, like JavaScript...
I don't believe so. I did the same as you (except with a Backbone app), and used an .htaccess to detect the fragment and serve up pages using Phantfom.
Comments
Does it matter that the JS-constructed HTML does not look anything like the spider-friendly version?
We're about to deploy an AngularJS application that is using PhantomJS to generate the spider-friendly content on the server. I'd much prefer to do this simpler method if it works just as well.
We're building a small-ish site now with Backbone where we do something similar with PhantomJS. In our `grunt build` task, phantomjs saves static versions of subpages. Each of those pages loads up the same backbone app, but the user (and search engine) sees the content they would expect to see no matter where they land – without waiting for Backbone to load and run through it's router. And it didn't take much time to setup.
Progressive enhancement is "The Right Way", for sure, but there are some projects where we just aren't concerned with targeting users without Javascript. That said, hopefully this will let us cater to many of those users, reap the SEO benefits, and provide a better first-landing experience for those not hitting the home page.
Edit: This is the grunt plugin we are using for this: https://github.com/cburgdorf/grunt-html-snapshot
Google's spiders prefer you not to try and 'detect' them and serve different content up to them. However, afaik they're fine with this technique (I mean, they even provide a spec to do so). See their content guidelines on 'Hidden text and links' [1]
[1] - https://support.google.com/webmasters/answer/66353?hl=en
I don't believe so. I did the same as you (except with a Backbone app), and used an .htaccess to detect the fragment and serve up pages using Phantfom.