5 ms·
It's both simple and revolutionary. It starts with saying "well, let's just render html on the client-side instead of on the backend". Suddenly you're in a new
by andrzejkrzywda 14y ago
It's both simple and revolutionary.
It starts with saying "well, let's just render html on the client-side instead of on the backend". Suddenly you're in a new world of programming.
- iso-8859-1 14y agoIt's document-generation versus API writing, as I see it.
- tluyben2 14y agoHow about Google SEO? If content is pulled via AJAX and rendered in the client; what does Google see?
- hunvreus 14y agoGoogle is actually starting to crawl that too. But more importantly, in many case it's not that much of a concern (private apps and/or content for example). And if you need so, you can follow Google's guidelines on the subject: https://developers.google.com/webmasters/ajax-crawling/ https://developers.google.com/webmasters/ajax-crawling/
- Isofarro 14y agoIt fails in practice though. Gawker tried this, and reverted it a few months later when it became clear that their traffic from search engines took a nose-dive.
- hunvreus 14y agoInteresting. You're sure it's not because most of the advertising business right now is organized around the "more pageviews == more prints == more $$" logic? It sure doesn't help to sell to advertisers. But we're mostly building products that need to sell to users, we care a lot more about UX and relevancy.
- Isofarro 14y agoVery sure. http://news.ycombinator.com/item?id=2596263 http://news.ycombinator.com/item?id=2596263 -- that's what I wrote two years ago: Once of the reasons Gawker moved away from hashbangs is that they weren't well supported by Google, despite this being a "Google specification". Nick Denton, the founder of Gawker, has some interesting tweets about the use of hashbangs over the past few months: Nick Denton: "Dip in uniques largely because of drop in Google refers. Pageviews (which are driven more by core audience) less affected." -- http://twitter.com/nicknotned/status/61152134929981440 http://twitter.com/nicknotned/status/61152134929981440 Nick Denton: "Google does not fully support "hashbang" URLs. So we're eliminating them rather than waiting for Mountain View." -- http://twitter.com/nicknotned/status/61465859079671808 http://twitter.com/nicknotned/status/61465859079671808 Nick Denton: "Yeah, I'd advise against hashbang urls. Will kill search traffic -- even if you abide by Google protocol." -- http://twitter.com/nicknotned/status/62595141927583745 http://twitter.com/nicknotned/status/62595141927583745 So here's a high-profile failure of hashbangs when it comes to being indexed by Google. Which means if it's search indexability you want, hashbangs isn't it. The Google spec just isn't mature enough, or well supported by Google search itself.
- RobAley 14y agoGoogle uses a crawler (allegedly) build on Chrome's internals, and renders a lot of Javascript/AJAX content just fine.
- mmahemoff 14y agoI'm not sure they'll index content based on this though (yet). It's probably used to check other algorithm drivers like page performance and spam tricks.
- blowski 14y agoThey do index at least some AJAX content - https://twitter.com/mattcutts/status/131425949597179904 https://twitter.com/mattcutts/status/131425949597179904.
- RobAley 14y agoThey have been doing for a while, at least for non-user-initiated ajaxy data : http://www.tomshardware.com/news/google-googlebot-ajax-javascript-content,13881.html http://www.tomshardware.com/news/google-googlebot-ajax-javas...
- steeve 14y agoOne approach is to use PhantomJS as your app server (much like you would use Django, Rails or something else) to render HTML for the crawlers. See http://github.com/steeve/angular-seo http://github.com/steeve/angular-seo
- crucialfelix 14y agothat's just crazy enough that it might work. have you run this in production ? it renders each fragment to a file and serves that to the bots, right ?
- steeve 14y agoit does, I'm doing a version for html5modes angular apps (slightly more complicated!) careful to only serve these pages to bots tho
- mmahemoff 14y agoSEO is really the last bastion, the one major benefit, of "the old way". Decent server-side JavaScript means there are becoming ways to deal with it. See the post from yesterday on AirBNB's dual-side JS approach. http://nerds.airbnb.com/weve-launched-our-first-nodejs-app-to-product http://nerds.airbnb.com/weve-launched-our-first-nodejs-app-t...
- andrzejkrzywda 14y agoThe best way seems to be returning different results to the Google bots. It's recommended by Google. It's not as much pain as you would think, it's enough to just return some html. No css/js is needed. Still, that's some additional work.
- Isofarro 14y agoNo. Returning different content to Googlebot is a technique called cloaking. http://en.wikipedia.org/wiki/Cloaking http://en.wikipedia.org/wiki/Cloaking Probably worth reading this: http://productforums.google.com/forum/#!category-topic/webmasters/crawling-indexing--ranking/4sVFlIdj7d8 http://productforums.google.com/forum/#!category-topic/webma... They'll accept geo-targeted or mobile vs desktop optimised content, but everything else is a grey area.
- andrzejkrzywda 14y agoThe official documentation is here: https://developers.google.com/webmasters/ajax-crawling https://developers.google.com/webmasters/ajax-crawling
- Isofarro 14y agoThat talks about using progressive enhancement as the primary approach to building websites.
- zanny 14y agoOne problem I see is that a lot of that page generation being moved to the client increases the first time page loads (which matter) and on a mobile device can prove very taxing on 3 - 4 year old hardware. I think it is more about do you want to figure out the html in JS or something else, and do you want to pay the bill to make the pages at home or lose some customers who don't have the power to do it themselves.
- andrzejkrzywda 14y agoIt's not all or nothing. You can do what Twitter did. Allow some duplication and render html server-side on the first request.
- hunvreus 14y agoAirbnb mentions that in a recent post: http://nerds.airbnb.com/weve-launched-our-first-nodejs-app-to-product http://nerds.airbnb.com/weve-launched-our-first-nodejs-app-t.... I think, ultimately, it depends on how your app is structured and how heavy is your feature set. We usually try and keep things as simple as possible, but we've experienced the issue a couple more complex apps and spent a good deal of time optimizing things and dynamically loading dependencies. They ain't no silver bullet: you have to decide where you want to invest your time.
- jacques_chester 14y agoShipping JS to a browser and then rendering the page with javascript DOM manipulation was the Hot New Thing in about about 1998, as I recall. It didn't last because, unsurprisingly, plain HTML loads renders a lot faster. That said: XHR is a genuine change in the model. So too the leaps and bounds in bandwidth and computing power.
- martinced 14y ago"So too the leaps and bounds in bandwidth and computing power." And JavaScript engines performances too. What is your point? You write in italics that "plain HTML renders a lot faster" and then you contradict yourself.
- jacques_chester 14y agoPlain HTML still renders faster.
- blowski 14y agoFirst page load, definitely. Subsequent updates - depends.
- jacques_chester 14y agoSure. Part of the confusion is that HTML is living a strange life as part document, part app platform. I mean if you compare HTML and JS to the fit-and-finish of a mid 90s platform it's a mess. But, it's what we have.