Skip to content

Three-Layer Caching & Revamped Fullstack Docs

Published on 2026-11-30

Following the release of Orbita v0.2.0, we are introducing a native three-layer caching architecture built in Rust (zero external dependencies) alongside a complete overhaul of the Fullstack Web documentation.


1. Three-Layer Caching Architecture

Performance shouldn't require wiring up Redis or external build tools on day one. Orbita now accelerates every layer of a web request out of the box:

Layer 1: Compiled .html Template Cache (automatic)

Every .html route, layout, and component template is compiled into Luau once and kept in memory — skipping repeated disk reads and HTML parsing while keeping per-request data 100% dynamic. In --watch dev mode, Orbita checks file mtime automatically and recompiles immediately on save.

Layer 2: HTTP Asset Cache (ETag + 304 + {{ asset(...) }})

Static files mounted with app:static("/public", "public") now ship with Symfony AssetMapper-style caching: - Content-hashed ETag headers and conditional 304 Not Modified responses (If-None-Match). - Smart Cache-Control: no-cache in --watch dev mode, public, max-age=31536000, immutable for versioned assets in production. - Built-in {{ asset('styles.css') }} helper in every .html template (and html.asset(...) in Lua), resolving to /public/styles.css?v=<hash8> automatically.

Layer 3: Application KV Cache (ob:cache)

A thread-safe, in-memory key-value cache with TTL, LRU eviction (max_entries), prefix invalidation, and Laravel/Rails-style cache.remember(...):

local cache = require("ob:cache")

local post = cache.remember("post:" .. ctx.params.id, 300, function()
    return Posts:find(ctx.params.id)
end)

-- Surgical or namespace invalidation on write
cache.delete("post:" .. id)
cache.delete_prefix("post:")

Read the full guide in ob:cache & HTTP Caching.


2. Revamped Documentation & Mini Blog Tutorial

We reorganized the documentation site for faster discovery:

  • Cleaner 5-tab navigation: Home, Getting Started, Runtime & API, Fullstack Web, and Blog.
  • Laravel-style Overview & Project Structure: a clear annotated map of ob.toml, config.toml, src/apps/, migrations/, public/, and ob g generators.
  • Django-style 5-Part Mini Blog Tutorial: build a complete fullstack app step by step — covering routing, SQLite models & JOINs, .html views & components, forms, Argon2id auth, ob:cache, interactive Islands, ob test, and single-file binary deployment.
  • Dedicated Guides: added ob:config & config.toml, HTML Templates (.html), and updated ob:http, ob:crypto (Argon2id), ob.class(), and --watch Live Reload docs.