Hacker News new | ask | show | jobs
by tshaddox 1526 days ago
> If that is correct then why is the javascript run on the server to begin with and not just sent directly to the browser?

Just the same ordinary reasons to generate HTML on the server: it allows you to support HTTP caching (in a CDN or even browser caching), it (potentially) lets the browser start rendering content much sooner, and it will be viewable by user agents (bots, scrapers, search engines, etc., but also humans) that don't run JavaScript.

1 comments

that makes sense, so if you're using http caching appropriately the server side "render" or running of the javascript happens on the first visit and then infrequently thereafter.