Static Site Generation
With static site generation you can render your application during the build phase and deploy it to any static hosting services such as Netlify, Github pages, Vercel etc. This means that no server is needed in order to deploy your application.
Generating your site
When deploying your site in with target:static all your
Step 1: Browser to CDN
When a browser sends the initial request, it will hit the CDN.
Step 2: CDN to Browser
Step 3: Browser to Browser
Navigating between pages with
<NuxtLink> is done on the client side so you don't hit the CDN again and all API calls will be loaded from the already cached static folder even if you hard refresh the browser.
Pages that have been excluded from generation, by using the
generate.exclude property will fallback to being a single page application. These pages will therefore not exist in the CDN and will be rendered on client side in the browser once the user navigates to that page.
Updating your content
In order to get new content to your site from your API you will need to regenerate your site again. With most static sites hosting providers you can do this by pushing your changes to your master branch via the git command or via a pull request.
The Preview mode will call your API or your CMS so you can see the changes live before deploying. See the preview mode on how to enable this feature.