5 ms·
This may be the case for pure single page apps, but any real world application will have some pages you want to load faster and have easily indexed by search en
by olegp 13y ago
This may be the case for pure single page apps, but any real world application will have some pages you want to load faster and have easily indexed by search engines.
At https://starthq.com https://starthq.com we started out as a single page app with a RESTful API using Angular, but with time it has become apparent that there are certain public pages that need to have the HTML generated server side. Now we have a hybrid solution, where some parts of the page are generated on the server and others, namely the parts that are different for anonymous and logged in users, on the client.
We've experimented with the likes of https://github.com/apiengine/seoserver https://github.com/apiengine/seoserver but the truth of the matter is it's actually easier to generate the HTML server side than using Angular.
- prodigal_erik 13y agoYikes, Angular can't generate semantic HTML at the server yet? That explains why http://docs.angularjs.org/misc/faq http://docs.angularjs.org/misc/faq is such a trainwreck. Letting crap like <a href="{{page.url}}">{{page.shortName}}</a> go out on the wire to be uselessly displayed by arbitrary clients (even ordinary browsers that don't blindly trust your scripts) is a really severe failure mode.
- jasallen 13y agoI agree that's an issue, and I also agree your workaround is the only one right now. That said, I view the architecture of having the client machine do view logic as being more sound, and I view the issue to which you refer as an SEO issue (rather than a fundamental problem) that the industry needs to come to grips with. Since AngularJS is from Google, I have a feeling they agree and we will be moving in that direction.