Modern web applications can be built in several quite different ways. A page might be rendered entirely on the server, assembled in the browser, generated ahead of time, or use a combination of all three.
It is easy to get caught up in the frameworks that make these approaches possible. But the more useful question is where the work should happen, and why. That decision affects performance, maintainability, infrastructure and, ultimately, the experience of using the application.
Start with the request
Regardless of the framework, a web application is still built around requests and responses.
A browser requests a page. The server responds with something the browser can use, whether that is a complete HTML document, a minimal page that loads JavaScript, or a previously generated file. From there, the application may make further requests to retrieve data or perform actions.
The architectural choice is largely about how much of the interface is prepared before it reaches the browser, and how much responsibility is handed over to JavaScript afterwards.
There is no single approach that is suitable for every application. A public-facing website and a complex, authenticated business system have very different requirements, even when they use the same technology.
Server-side rendering
Server-side rendering (SSR) means generating the page's HTML on the server before sending it to the browser.
This is not a new idea. Traditional server-rendered applications have worked this way for decades. A request reaches the application, it gathers the necessary data, renders a template and returns HTML.
Modern frameworks have expanded on that model. Some can render component-based interfaces on the server and then run the corresponding JavaScript in the browser to make those interfaces interactive. This process is known as hydration.
The immediate benefit is that the browser can receive meaningful HTML without first having to execute the whole application. That can be particularly useful for content-heavy pages, users on slower devices and pages intended to be discoverable through search engines.
There are costs, however. Rendering work has to happen somewhere, and an uncached server-rendered response can introduce additional processing and data-fetching time. Hydrated applications can also send considerable amounts of JavaScript to the browser, despite having already rendered the initial HTML.
SSR is therefore not a guarantee of good performance. It is a technique that can help when used appropriately.
Client-side rendering
With client-side rendering (CSR), the browser receives an initial document and JavaScript takes responsibility for building much of the interface.
This became especially popular with single-page applications. Once loaded, the application can navigate between views and update the interface without requesting an entirely new HTML document for every interaction.
It works well for highly interactive applications: dashboards, internal tools and systems in which users spend a considerable amount of time working within the same interface.
The trade-off is the initial load. If the content depends on JavaScript downloading, executing and then requesting data from an API, there can be a noticeable delay before anything useful appears. Slower devices and connections tend to make that more apparent.
It also changes where complexity lives. The frontend often becomes responsible for routing, loading states, error handling, local application state and coordinating requests with the backend. None of those are inherently bad, but they are responsibilities worth accounting for.
For an authenticated application, client-side rendering can be perfectly reasonable. The important thing is to choose it because the application's behaviour warrants it, rather than because a JavaScript framework happens to be available.
Static generation and caching
Some pages do not need to be generated on every request.
Static generation produces HTML ahead of time, usually during a build process. The resulting files can be served without executing application rendering logic for each visitor, often through a content delivery network.
Documentation, informational pages and relatively infrequently changing content can be good candidates.
The difficulty is keeping that content current. If a page changes, something needs to regenerate or invalidate the previous version. The more dynamic the information becomes, the more thought needs to go into that process.
Caching can offer similar benefits for server-rendered pages, provided the application has a clear strategy for what can be cached and when it must be refreshed.
That distinction matters especially for applications with authenticated users. A public article can often be shared from a cache. A page containing someone's account information must not accidentally become a shared response.
Hybrid approaches
Real applications rarely fit neatly into one category.
Consider a platform with a public website, an information centre and a private dashboard. The public pages might benefit from static generation or server-side rendering. The dashboard might be better served by a highly interactive, client-driven interface. Individual routes could use different caching and rendering rules.
This is broadly what hybrid rendering makes possible: choosing an approach according to the needs of a particular page or section rather than imposing the same strategy everywhere.
It is also important to distinguish hybrid rendering from hydration. A server-rendered page that becomes interactive in the browser uses both server and client execution; a hybrid application may additionally choose completely different rendering strategies for different routes.
Frameworks such as Nuxt support route-specific rendering rules, but the underlying idea is more important than any particular implementation.
Architecture is more than rendering
Where a page is rendered is only one part of the application.
We also need to decide how the interface communicates with business logic, where validation takes place, how authentication works and which parts of the system are responsible for accessing data.
A separate frontend and backend API can be a sensible choice, particularly when multiple clients need to consume the same service. But splitting an application into independently deployed services simply because it is considered modern can create additional work: duplicated contracts, more deployments, authentication across boundaries and extra failure points.
There are alternatives. Laravel with Inertia, for example, allows an application to use Vue for its interface while keeping routing and much of the application flow on the server. It is possible to build a rich interface without first building a separate API for every screen.
Neither arrangement is inherently superior. The choice should follow the product's requirements, rather than dictate them.
Whatever happens in the browser, the server remains responsible for enforcing authorisation and validating operations that affect protected data. A convenient frontend state model is not a security boundary.
Choosing an approach
Before committing to a rendering strategy, I think it is worth asking a few practical questions.
- Who is using the application? A public information page has different priorities from an authenticated administration system.
- How interactive is it? Reading an article is not the same experience as working in a complex dashboard.
- How frequently does the data change? Static output may be appropriate for content that changes occasionally, but less useful for rapidly changing, user-specific information.
- What does the initial experience look like? A fast transition between screens matters, but so does how quickly the first useful content appears.
- What must the team maintain? Every additional runtime, deployment, API contract and caching rule has a cost.
- How will it be measured? Real-device testing and production performance data are more useful than assuming a rendering technique will automatically be faster.
These are not questions that can always be settled at the start of a project. Requirements change, and an architecture needs to leave room for that.
Keeping the architecture proportionate
One of the more common mistakes in software development is treating architectural complexity as a sign of sophistication.
It is tempting to build for every possible future requirement. Separate services, elaborate caching systems and multiple rendering pipelines can all seem like sensible preparation for growth. Sometimes they are. Often, though, they solve problems the application does not yet have.
A straightforward server-rendered application may be entirely sufficient. A client-rendered dashboard may be the simplest solution. A hybrid approach may give a larger product the flexibility it genuinely needs.
The objective is not to use the newest approach, or to make every part of a system work in the same way. It is to choose sensible boundaries, understand the trade-offs and build something that can be maintained as the application evolves.
Good architecture should make the application easier to work with, not become an additional problem to solve.