O que é Static Site Generation (SSG)?
Definição Rápida
A Static Site Generation é um método de construção de websites em que todas as páginas são pré-renderizadas durante o processo de build como ficheiros HTML estáticos, resultando em tempos de carregamento extremamente rápidos.
Static Site Generation (SSG) creates all of a website's pages during a build step, before any user visits the site. The result is a collection of plain HTML, CSS, and JavaScript files that can be served directly by a CDN without any server-side processing per request.
Unlike dynamic websites that generate pages on every request (SSR) or in the browser (CSR), static sites are pre-built. When a user visits a page, they receive a pre-made HTML file instantly. This eliminates server processing time and database queries, resulting in the fastest possible load times.
Popular static site generators include Next.js (which supports both SSG and SSR), Gatsby, Hugo, Eleventy, and Astro. These tools take your content (from markdown files, a CMS, or an API) and templates, then generate a complete website during the build process.
SSG is ideal for websites where content doesn't change with every request: blogs, documentation sites, marketing websites, landing pages, and portfolio sites. For content that changes frequently, many SSG frameworks support Incremental Static Regeneration (ISR), which rebuilds only the pages that need updating.
Por Que é Importante
Static sites are the fastest, most secure, and cheapest to host. Since there's no server processing or database, there's nothing to hack and nothing to slow down. They can be hosted on a CDN for pennies per month and handle millions of visitors without performance degradation.
For businesses, this translates to better user experience, higher conversion rates, reduced hosting costs, and fewer security concerns. If your website's content doesn't need to be dynamically generated per request, SSG is often the smartest choice.
Exemplos Reais
A documentation site with 5,000 pages built with SSG loads every page in under 200ms because there's zero server processing, just serving pre-built HTML from a CDN
A marketing agency switched their client websites from WordPress to a static site generator, reducing hosting costs by 90% while improving page speed scores to near-perfect
A blog with 1,000+ articles uses SSG with incremental rebuilds, adding new content in seconds without regenerating the entire site
A landing page built with SSG achieved a 99/100 Lighthouse performance score out of the box, compared to 62/100 for the previous dynamically-generated version
Termos Relacionados
Server-Side Rendering (SSR)
O Server-Side Rendering é uma técnica pela qual as páginas web são geradas no servidor em cada pedido, enviando HTML completo ao browser para carregamentos iniciais rápidos.
CDN (Content Delivery Network)
Uma CDN é uma rede de servidores distribuídos geograficamente que entrega conteúdo web aos utilizadores a partir do servidor mais próximo, reduzindo os tempos de carregamento.
Single-Page Application (SPA)
Uma Single-Page Application é uma aplicação web que carrega uma única página HTML e actualiza o conteúdo de forma dinâmica à medida que o utilizador interage com ela.
CMS (Content Management System)
Um CMS é um software que permite aos utilizadores criar, gerir e modificar conteúdo num website sem escrever código, oferecendo uma interface intuitiva para publicação.
Precisa de ajuda com static site generation (ssg)?
A nossa equipa pode ajudá-lo a colocar este conceito em prática. Obtenha uma consulta gratuita para falar sobre o seu projecto.