You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

0 Días
10 Hrs
22 Min
5 Seg

¿Qué es el Server Side Render?

4/17
Resources

What is client-side rendering and server-side rendering?

With the growth of web applications, it is crucial to understand how rendering strategies affect efficiency and user experience. Two such strategies are client-side rendering (Client-side Render) and server-side rendering (Server-side Render). Both techniques have advantages and disadvantages that must be considered depending on the needs of the application.

How does client-side rendering work?

In client-side rendering, all the application logic and necessary files, such as HTML, CSS, and JavaScript, are first downloaded to the user's browser, also known as "the client".

  1. Initial request: The browser requests the web application from the server.
  2. File download: The server sends the HTML file, followed by the index.js file, which is the entry point for the application.
  3. Execution: The index.js file is executed in the browser, triggering frameworks such as React, which build the DOM tree, generating interactivity.

During these stages, the user sees a blank screen until React completes its task, which can negatively affect the user experience due to the lack of immediate visual feedback.

How does server-side rendering work?

Server-side rendering attempts to mitigate the problems of client-side rendering by speeding up the loading of the main content visible to the user.

  1. Fast initial response: The client requests an HTML file from the server. This file is generated and sent by the server as a "template" that is quickly drawn in the browser.
  2. Content display: The browser already displays content before the JavaScript and CSS files have finished downloading.
  3. Interactivity: Once the JavaScript files are ready, frameworks such as React are executed, allowing user interaction.

This approach allows a preview of the application to load quickly, improving the perception of speed and improving SEO, especially useful in applications with multiple paths.

When should server-side rendering be used?

Choosing the right rendering technique depends on several factors. Server-side rendering is an excellent choice when:

  • SEO is essential: It is vital for applications that need to be indexed efficiently by search engines.
  • Optimal performance: Facilitates faster load speeds, presenting content sooner than client-based applications.
  • Security: Provides an additional level of security by reducing the complete dependency on JavaScript until it executes in the browser.
  • Multi-pathed applications: Enhances the experience, particularly when users are expected to quickly switch between different views/modalities.

In summary, a clear understanding of the differences between these two rendering methods, as well as their practical application, is key to optimizing the efficiency of our web applications. Delving deeper into the subject will allow us to evaluate the advantages and disadvantages of each approach, guiding the design of our web solutions towards success.

Contributions 3

Questions 1

Sort by:

Want to see more contributions, questions and answers from the community?

CSR Client Side Render:
Es una técnica de renderizado en la cual nuestra aplicación con todos sus archivos(HTML, CSS y JS) es ejecutada completamente en el navegador(cliente)

SSR Server Side Rendering:
Es una técnica de renderizado en la cual se manda directamente el HTML que el usuario va a consumir desde el servidor para darle una respuesta inicial mucho mas rápida.
Después se ejecutan los archivos como CSS o JS del lado del cliente

¿Cuándo usar SSR?

  • Aplicaciones con múltiples rutas
  • Aplicaciones con necesidad de un alto performance
  • Aplicaciones que necesiten priorizar el SEO
  • Aplicaciones que necesiten aumentar su seguridad del lado del cliente
Server Side Rendering no es sinónimo de alto performance, pues si desde el servidor te pones a renderizar un archivo muy demandante, puede aumentar el tiempo de que el cliente reciba una mínima respuesta. Sería terrible, una página en blanco sin ninguna respuesta! Hasta que al fin llegue el HTML ya renderizado desde el servidor. Esto es un tema de trade-offs. Recomiendo echarle un vistazo el tema de Web Core Vitals. Este tiempo desde que el navegador hace una petición hasta que le llega una mínima respuesta se llama "Time to First Byte (TTFB)". Server Side Rendering sacrifica TTFB
El Server Side Rendering (SSR) es una técnica donde el contenido HTML se genera en el servidor y se envía al cliente, permitiendo un tiempo de carga inicial más rápido y mejorando el SEO. Aquí tienes un resumen esquemático de los conceptos clave: 1. **Definición**: - SSR envía HTML pre-renderizado desde el servidor al cliente. 2. **Problemas de SPA**: - Dependencia de JavaScript puede afectar el SEO y la carga inicial. 3. **Beneficios**: - Mejora el rendimiento y la seguridad. - Proporciona contenido indexable por motores de búsqueda. - Reduce el tiempo hasta que los usuarios ven contenido en pantalla. Este resumen integra los puntos discutidos en la clase y los conceptos aprendidos en cursos relacionados.