DEV Community

Discussion on: Vue + Relay + Server Side Rendering (SSR)

Collapse
oguimbal profile image
Olivier Guimbal

It can also be useful to improve time to first time paint: Downloading a non interactive version of your first page (plain html) is usually quite cheap. Downloading+parsing+executing a big fat js can take some time, and people like the "wow" effect of a website that loads instantly.

Collapse
divporter profile image
David Porter Author

For this I would recommend pre-rendering if you can get away with it. This is typically done with a headless browser module like puppeteer. It's generally easier to implement but too slow to do on the fly so it's done offline.

Thread Thread
oguimbal profile image
Olivier Guimbal • Edited on

Right, but pre-rendering is hard when you have user data (ex: a public personal profile). But anyway, is there much difference between pre-rendering and SSR with a cache ?
For instance, when running your SSR on lambda@edge, cloudfront can cache the results, which makes further requests kind-of pre-rendered, isnt it ?

By the way, to mention my comment on your other article: I precisely used Cloudflare Workers to do just that (and for their <10ms cold startup time). They make it really easy to tweak caching via their distributed key-value store which you can access from your edge locations => That's way more powerful compared to a cloudfront cache you cannot control. I'll post an article about that when I have time to spare.

Thread Thread
divporter profile image
David Porter Author

I use pre-rendering to render the shell of the app (nav, footer, background etc) for a rapid first paint. It's much easier to set up. But you're spot on, with caching the actual SSR won't happen that often. I only do full SSR for SEO, regular users get the pre-rendered shell.