Deploying an SSR app to Fastly
This is a collection of experiences trying to deploy a Server Rendered Application to Fastly.
Video: https://youtu.be/vw0Ku17gjpI
Task | Description of issues | Issue Link |
---|---|---|
Create Pages site | No interactive way to do this, need to open documentation to create gitlab-ci.yml | gitlab-org/gitlab#343557 (closed) |
Update Nuxt deployment folder | GitLab Pages only supports a folder for built sites called public . Default for nuxt and next is dist , so I needed to update the nuxt.config.js to change the default |
gitlab-org/gitlab#345381 (moved) |
Build pipeline | Using the image node:latest failed, needed to use node:lts
|
- |
Fastly - setting Host | Fastly requires a Host to cache. GitlabPages shows a URL (https://gitlab-org.gitlab.io/incubation-engineering/jamstack/nuxt-app), that Fastly doesn't accept. Instead, using gitlab-org.gitlab.io as host is suffcient when adding the Fastly domain to pages (see below) |
tbd |
Workaround: add the domain that actually points to Fastly servers to the GitLab Pages settings. (This allows gitlab to connect requests from Fastly to the project) | No verification or Certificate is needed. The fact that this works seems unintentional, so maybe update the UI to reflect this | tbd |
Results
Loading the page directly from GitLab Pages (no CDN):
First load via CDN (no TLS)
Subsequent loads via CDN (no TLS)
First load via CDN (with TLS)
Subsequent load via CDN (with TLS)
Edited by Janis Altherr