Skip to content

Instantly share code, notes, and snippets.

@kmamykin
Last active February 15, 2017 18:31
Show Gist options
  • Save kmamykin/41206161356fe852abbc5938e5a64034 to your computer and use it in GitHub Desktop.
Save kmamykin/41206161356fe852abbc5938e5a64034 to your computer and use it in GitHub Desktop.
Asiago SEO architecture

Introduction

Goal: architect Brickwork front pages SEO such that:

  • Google is able to index and see content
  • Other search bots can index and see content (+)
  • Clients can install asiago on their site and enjoy benefits of SEO (++)

Option 1: Handle bot responses in rails app (outside of Asiago)

  • sitemap.xml is already served from rails app.
  • Need detect bots and serve JSON-LD and simplified/plain content for store/feature/event pages.
    • hard to reuse for retailers hosting asiago pages
    • duplication?

Option 2: Rely on Google executing JS on page, and optimize Asiago for this

  • Pro: no extra infra required.
  • Con: No visibility why Google does or does not render page.

Possible improvements that may help:

  • fast to render, which comes down to have API data readily available
    1. preload data in the pages that rails app serves
    2. API to respond to ...store-slug.js urls that get linked through <script> tag, and set window.store = {...}, which reduce the time to render Asiago page
  • handle special features potentially missing from the Googlebot browser (e.g. WebGL, GeoLocation)

Option 3: Build infrastructure to prerender pages into static HTML and serve it for bots

Here we build infrastructure to specifically process search bot traffic and serve pre-rendered content. Pre-rendering of pages can be used just to handle bot traffic, or (in addition) to improve the first render of a page for users (requires more testing, may be phase 2).

One piece of the infrastructre is a prerender app, that takes any url as parameter of request, prerenders it, and returns HTML as response. It is a generic app that can be used for any pre-rendering need (not specific to brickwork business). It can also be used to help retail clients to pre-render pages. The decision here is how to host it, options are: hosted service on prerender.io, heroku app, aws beanstock, serverless.

Another piece of infrastructure is the handling of bot requests. It can be done in the rails app through middleware, or at CloudFront though Lambda@Edge.

My notes on working with prerender.io (https://gist.github.com/kmamykin/48c41ae19d571c2c99370334d7de56da)

Next Steps:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment