Deploy
Deploy
Where a krantho site can run: hosts, CDNs, databases and media stores side by side, with the page cache strategy each combination uses.
| Amazon CloudFront | Google Cloud CDN | Node.js server | Vercel | |
|---|---|---|---|---|
| Kind | CDN | CDN | Server | Platform |
| Page cache | cdn | cdn | none | next-isr |
| Frameworks |
|
|
|
|
| Databases |
|
|
|
|
| Media stores |
|
|
|
|
none- Every request renders the page.
next-isr- Next.js keeps each page until a change invalidates it.
cdn- The CDN keeps each page until a change purges it.
- CDN
cdnAmazon CloudFront
Put Amazon CloudFront in front of a krantho site. Each page stays at the edge until a content change purges it, by cache tag for SvelteKit and Express and by path for Next.js.
- CDN
cdnGoogle Cloud CDN
Put Google Cloud CDN in front of a krantho site. Each page stays at the edge until a content change purges it, by cache tag for SvelteKit and Express and by path for Next.js.
- Server
noneNode.js server
Run a krantho site as a Node process in a container or on a VM, with SQLite on a disk or Postgres, and pages rendered per request or cached by Next.js.
- Platform
next-isrVercel
Run a krantho site on Vercel Functions, with pages served from Vercel's CDN until a change invalidates them, content in Postgres and uploads in an object store.
Krantho runs inside your app, so it goes wherever your app goes. The hosts, CDNs, databases and media stores below are alternatives, listed in no preferred order. Each page shows how to set one up, the configuration it needs, how pages are cached there, and how to check that it works.
Content between deploys
Editors change content on the live site, and developers change it in the repository. Krantho moves it both ways, on every host on this page. On Vercel, for example, Studio writes to the site's Postgres database. When you want the editors' work in git, krantho export pulls it from the production API as markdown files, and you commit and push them.
The push builds a new deployment, and the build writes a content manifest (Ship content file changes with a deploy). When the deployment starts, the server compares each file with its document. New and changed files are imported. A document an editor has changed since keeps the editor's version, and the clash is recorded as a conflict. A checkpoint is taken before anything is imported. Deploy to Vercel has the full setup.
export KRANTHO_API_URL=https://example.com
krantho auth login --token "$KRANTHO_API_TOKEN"
krantho export pages --out content/pages
git add content/pages
git commit -m "content: the editors' changes"
git push