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

Society has evolved past the need for Jinja templates #3

Open
devinmatte opened this issue Oct 22, 2022 · 2 comments
Open

Society has evolved past the need for Jinja templates #3

devinmatte opened this issue Oct 22, 2022 · 2 comments

Comments

@devinmatte
Copy link
Member

Serverside rendering kinda cringe

@WillNilges
Copy link
Member

As a computer engineer, I do not understand why server side rendering engines, such as Jinja, are "cringe." What makes them so? Does this mean that Gin should be avoided for serverside rendering as well?

@devinmatte
Copy link
Member Author

So real talk, serverside rendering has it's uses, if it's rendering specific parts of a page and not the whole page.

tl;dr: All in all, clientside rendering with backend data parsing is the modern strategy, it creates a better user experience and reduces performance bottlenecks. Serverside rendering creates a single bottleneck for page display and usage.

Generally the modern pattern for web development is to build a backend API with a series of endpoints, and a clientside frontend that makes multiple API endpoints to render the page in pieces.

The reason for this is that serverside rendering a full view creates a single bottleneck. Let's say you have a app like Conditional with hundreds of results being rendered at once. In order for the page to even load, the sql needs to complete, the python needs the parse it, then it needs to render the html, and then the browser needs to load that HTML over the wire. That's a lot of steps just to load a page.

With clientside rendering (JavaScript, react, vue, whatever) two things happen in parallel. The page itself loads and has 0 data, but at least you have a visible page with buttons and the frame. The frontend right away calls a backend API which calls SQL and parses with python. But now that's it. There's no HTML rendering and the data is smaller to send over the wire. Now the page takes that data and renders it. There's less data to render since the frame of the site is rendered, so it's quicker.

This is not to say serverside rendering never has a place, it just shouldn't be a default like CSH has made it (partially my fault) and it shouldn't be an all or nothing serverside rendering like this.

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

No branches or pull requests

2 participants