Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server rendering to improve load time performance #1

Open
wants to merge 48 commits into
base: master
Choose a base branch
from

Conversation

OliverJAsh
Copy link
Owner

Demo: https://simple-offline-blog.herokuapp.com/

For these users:

  • First time users, who won't yet have the ServiceWorker installed;
  • Users without ServiceWorker support;
  • Users without JS (unlikely, but hey)

… rendering on the server will improve load times, because the content is in the very first request for the HTML. No further network requests nor JS execution needed.

I took the shared rendering approach for its nice developer ergonomics. Server renders the core content, client re-renders to enhance the content, all using the same template code.

Here is the updated architecture blob:

  • Server renders content, client renders with enhanced content. Both renders
    share the same template (aka isomorphism or shared rendering).
  • A ServiceWorker is installed on first visit. Subsequent navigation requests
    will be proxied by the ServiceWorker, which will respond with a cached shell
    (a wrapper for the content). The shell contains JavaScript which is
    responsible for fetching and rendering content.

Note that this means browsers without ServiceWorker support will just continue
to use server side rendering.

@OliverJAsh OliverJAsh changed the title Shared rendering to improve load time performance Server rendering to improve load time performance Sep 27, 2015
@OliverJAsh OliverJAsh force-pushed the server-side-rendering branch from f952c56 to 224593d Compare September 27, 2015 22:18
@OliverJAsh
Copy link
Owner Author

TODO: Use content negotiation

@OliverJAsh OliverJAsh force-pushed the server-side-rendering branch from 7a8def2 to 68af1bf Compare November 22, 2015 07:52
@OliverJAsh OliverJAsh force-pushed the server-side-rendering branch from 68af1bf to 0ed48bf Compare November 22, 2015 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant