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
Copy link
Owner Author

TODO: Use content negotiation

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.

None yet

1 participant