Ad

How Can I Overcome The SEO Implications Of Rendering Content Using Client-side JS With FireBase?

- 1 answer

I'm interested in using FireBase as a data-store for the creation of largely traditional, occasionally updated websites and am concerned about the SEO implications of rendering content using client-side JavaScript.

I know Google has made headway into indexing some JavaScript content, but am wondering what my best course of action is. I know I have some options:

  • Render content using 100% client-side JS, and probably suffer some indexing trouble
  • Build static HTML files on the server side (using Node, most likely) and serve them instead

First, I'm not sure how bad the problem actually is doing everything client side (am I solving something that needs solved?). And second, I just wonder if I'm missing some other obvious way to approach this.

Ad

Answer

Unfortunately, rendering data on the client-side generally makes it difficult to do SEO. Firebase is really intended for use with dynamic data, such as user account info, game data, etc, where SEO is not a goal.

That being said there are a few things you can do to optimize for SEO. First, you can render as much of your site as possible at compile time using a templating tool like mustache. This is what we did on the Firebase.com website (the entire site is static except for the tutorial and examples).

Second, if your app uses hash fragments in the URL for navigation (anything after the "#!"), you can provide a separate set of static or server-generated pages that correspond to your dynamic pages so that crawlers can read the data. Google has a spec for doing this, which you can see here: https://developers.google.com/webmasters/ajax-crawling/docs/specification

Ad
source: stackoverflow.com
Ad