This release brings a set of carefully crafted improvements born directly out of working on the TriFrost documentation.
As we refined the docs, we uncovered small inconsistencies, rough edges, and opportunities to make the developer experience even smoother. This update is the result of that hands-on process — tightening the middleware, expanding ergonomic options, and sharpening semantic clarity across the framework.
Improved
- feat:
Cors
middleware now supports passing an array of origin strings (string[]
), alongside the existing single string or dynamic function — making origin whitelisting simpler and less verbose.
app.use(Cors({
origin: ['https://site1.com', 'https://site2.com']
}));
- feat: The
CacheControl
middleware and correspondingcacheControl
options on context responders now supportproxyMaxage
(letting you finely control how long shared caches (like CDNs) can store content). - feat: The
CacheControl
middleware and correspondingcacheControl
options on context responders now supportproxyRevalidate
(forces shared caches to revalidate stale responses). - feat: The
CacheControl
middleware and correspondingcacheControl
options on context responders now supportmustRevalidate
(signaling that stale content must be revalidated with the origin). - feat: The
CacheControl
middleware and correspondingcacheControl
options on context responders now supportimmutable
(marking responses as never changing — perfect for long-lived static assets).
app.use(CacheControl({
type: 'public',
maxage: 60, // browsers: 1 min
proxyMaxage: 600, // CDNs: 10 min
immutable: true,
mustRevalidate: true,
proxyRevalidate: true
}));
- deps: Upgrade @cloudflare/workers-types to 4.20250531.0
- deps: Upgrade @types/node to 22.15.29
- deps: Upgrade eslint to 9.28.0
Breaking
- The
cache
option onctx.html
,ctx.file
,ctx.text
,ctx.json
has been renamed tocacheControl
for better semantic clarity. Reflecting that it applies HTTPCache-Control
headers, not the internalcache
storage system. This improves naming alignment and reduces confusion between storage-level caching and response-level caching.