Skip to content

Instantly share code, notes, and snippets.

@novaknole
Created December 5, 2020 15:03
Show Gist options
  • Save novaknole/ac5f6494ba799cb612bef184a4e5cd0f to your computer and use it in GitHub Desktop.
Save novaknole/ac5f6494ba799cb612bef184a4e5cd0f to your computer and use it in GitHub Desktop.
CASE 2: Not First Page Load
SSR: After clicking on a link to move to another page, the browser has to make a request to the server,
which would have to do everything (async calls, creating html, putting data in it) and then returning it.
Operations = html request + async call + creating html + putting data into html
note 1: async call happens from a server, that should be super fast.
note 2: creating html + putting data into html happens on a server, so that should be super fast.
SPA: the client doesn't need to make a request to the server for getting html file. It would only need to
make a async request to fetch data.
Operations = async call + putting data into DOM
If async calls are pretty slim(which they are 99% of the time - passing request body as 6-7 parameters wouldn't
make any difference), I don't actually see the difference. If one could say that async calls in SSR happens on a server,
that's why it would be faster, I'd not agree. The reason is, async call in SSR would be faster than async call in client
, but in SSR, we also have html request which would take time too.
So difference is negligible, who knows which one might end up faster at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment