2 ms·
> 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 ge
by tshaddox 5y 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.
- chasd00 5y agothat 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.