Performance
How Docup serves pages quickly: server rendering, a page cache, prefetching and small client code.
Documentation should feel instant. Docup is built so that the pages readers open are already drawn.
What makes pages fast#
- Server rendering. Pages are complete HTML on arrival. Markdown is rendered and code is highlighted on the server, so readers download no Markdown parser or highlighter.
- Page cache. The first view of a page draws it. The finished response is stored, and every later reader gets that copy without the app running. Cached pages include the full page, the data a click inside the site fetches, the generated files, and the marketing pages (cached separately for signed-in and signed-out visitors).
- Cached site data. A site's settings, brand and navigation are kept in Redis for ten minutes, so rendering does not wait on the database.
- Prefetching. When a reader hovers, focuses, or touches a link, the next page is loaded ahead of time. Eager links (the next and previous page) are preloaded as soon as the browser is idle, making clicks instant even on mobile devices with no hover. Prefetches are not counted as views.
- Small pages. The navigation list carries titles and summaries only, not page text.
- Cloudflare Workers. Docup runs on Cloudflare's network, so there are no servers to wake up.
When the cache refreshes#
You never clear a cache by hand.
| Event | Effect |
|---|---|
| Publish, unpublish, address change, or a settings change | The site's cached copies are removed, and pages are drawn fresh on the next view. |
| An update after a push publishes a page | The same. |
| Time | Cached pages expire after twelve hours. Site data expires after ten minutes. |
| A new deploy of Docup | Starts with no cached pages, because pages name the script files of their deploy. |
For ten seconds after a change, pages are drawn without being stored. This prevents a page drawn just before the change from being cached after it.
Images and Ask AI are never cached as pages. Your uploaded logo, favicon and social image are served with a one-day cache lifetime and a version in the address, so a new upload shows immediately.
Check it yourself#
A cached response carries an x-docup-cache: hit header and a server-timing: cache;dur=... header showing how long the lookup took. Open the Network panel of your browser's developer tools and reload a page twice.
curl -sI https://your-address.docup.dev/ | grep -i x-docup-cacheReader privacy and speed#
Analytics are recorded after the response is sent, so counting a view never slows a page down. See Analytics.