Skip to content

Society has evolved past the need for Jinja templates #3

Open

Description

@devinmatte

Serverside rendering kinda cringe

Activity

  1. WillNilges commented on Oct 23, 2022

    @WillNilges
    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?

  2. devinmatte commented on Oct 23, 2022

    @devinmatte
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions