API Maker
The backend engine for the AI era
SSR websitesEpisode 50 7:13 10 chapters November 2026
A website has to be fast, found by search engines, and safe with the code and pictures it sends. Give the Calm Home shop a page cache, the head and JSON-LD of every page, robots.txt and a sitemap with every product, a UI library pinned by its hashes, smaller images, and a domain of its own.
In the playlists The complete course SSR websites
A website must be fast, found by search engines, and safe with the code and pictures it sends. In this video, the Calm Home shop gets a page cache, SEO, a UI library pinned by its hashes, smaller images, and its own domain.
Going live usually means more work. A cache in front of the site, with rules and purges. And one day, the page of a signed in customer is served to everyone. An SEO plugin for each framework. Script tags copied from a CDN without their hashes. And a separate pipeline for images. With API Maker, a page says how long the server keeps it. A personal page is never shared.
The server writes the head, the sitemap, and robots. Libraries are pinned with their hashes. And images are made smaller in the panel. In this video: the page cache, what it saves, the head of a page and its JSON-LD, robots and the sitemap, UI libraries, images, security by default, and going live.
The page of a product says it in its config. It is kept for sixty seconds, for everyone, with the tag products. After that, it is sent a little old for five more minutes, while one request renders it again. The Routes view shows a bolt for every kept page, and who can open each page. The account pages are for signed in customers, as their layout says. The first request renders the page, with three reads of MongoDB.
It is a miss, in a few milliseconds. The next requests are hits, in a fraction of a millisecond. That is many times faster. A part of the address that the page does not use, like utm source, makes no new copy. And a save of the website clears every copy, so the next request renders the new version. The cache never shows the wrong page. A page is kept for everyone only when it says public, and the visitor is not signed in.
A page that read a cookie, a header, or the address of its visitor is never shared. ctx dot revalidate clears every page of a tag, for example after a change of stock. And each copy keeps a place for the CSRF token, so every visitor still gets their own.
Search engines and social networks read the head of a page. The template already gives this page a title, a description, and a canonical address, from its data. Import serialize, give the page a picture for shared links, and write the JSON-LD of the product: its name, its description, and its price. Save it. A visitor sees the same page. The server writes the head. It writes the title through the title template, the description, Open Graph, and the card of a shared link, with full addresses, and the canonical address.
The JSON-LD comes out as safe JSON, because serialize escapes anything that could close the script.
robots dot txt allows every page, and names the sitemap. sitemap dot xml lists the pages that are for everyone. The account pages are closed by their layout, so they are not in it. A page that takes a value, like the page of each product, is listed by an endpoint. sitemap dot xml dot ts reads the catalog and answers with the XML, with one address for each of the thirty six products.
UI libraries lists what the browsers of the visitors load. For this shop, it is Bootstrap and its icons. The catalog has the common libraries, each pinned to a version. GLightbox shows its files, each with its SHA 384 hash, and how a page uses it. Load it only on the pages of the products, and add it. In the page, every file of a library carries its hash. So if a file is changed on the CDN, the browser refuses it.
A page that does not load GLightbox does not mention it. The content security policy lets in the origin of the libraries, and the nonce of this answer. So a script tag written by hand does not run. And you can host a library with the website instead. Its files are copied to public, and checked against the same hashes.
Photos straight from a camera weigh megabytes. Right click on the folder of images, and pick Compress images. There are two prints, several megabytes in all. Pick WebP, and get an estimate first. Nothing is written yet. Click Compress. The panel says what it writes, and that Git keeps the originals. Megabytes are saved, and most of the weight is gone. Location data is removed, and photos are turned upright.
And security comes by default. Every value a page shows is escaped. Every answer has a strict content security policy, with its own nonce. It also has the headers that keep it out of frames of other sites, keep its type as sent, and turn the camera and microphone off. Forms carry their CSRF token, sessions are sealed, and a page reaches only its tables, columns, and rows.
Now we go live. A website answers on the port of the APIs, after the path of its account and its name. List its domain in site dot config, and point a reverse proxy at it. For that host, every link, asset, and redirect loses the prefix, and robots names the sitemap at the domain. Behind HTTPS, the session cookie is Secure, and browsers get strict transport security. Every server of the installation answers every website.
It is one program, and one deployment. A save, or a Git pull, makes a new version on every server. The settings of the installation give the threads that render, the memory and time of a page, and the size of the page cache. And every website is a folder in Git, kept in sync with VS Code by the local client, with a guide in the docs for AI assistants.
To sum up. The server keeps pages, and never shows the wrong one. The server writes the head, JSON-LD, robots, and the sitemap. UI libraries are pinned with their hashes. Images are made smaller in the panel. And it is safe by default, on its own domain. Next: the whole Calm Home storefront. API Maker. Build faster, spend smarter, deliver better.
Length 5:34SSR storefront
Length 6:15SSR websites
Length 7:45SSR websites
Length 7:26Architecture