Fresh
Fresh scores 7 of 28 points. That is 2 of 14 on the 7 features that affect first paint (the moment the browser first draws content), and 5 of 14 on the 7 other features.
- Version checked
- Fresh 2.3.3 (jsr:@fresh/core, JSR latest; Deno; docs at usefresh.dev)
- Performance guide
- Islands | Fresh docsNo dedicated performance page; closest official page.
- Issues
- github.com/freshframework/fresh/issues
Scorecard
All 14 features, in two groups. Each row shows Fresh's label, how that label compares across all 23 frameworks, and how to enable the feature. Feature names link to Fresh's entry on that feature's page.
Fresh's labels across 14 features
- 1st-party2
- Experimental0
- Third-party3
- Manual9
- of 14
How it compares
On 2 of 14 features, no framework has a higher-scoring label than Fresh. On the other 12, at least one does.
Tested in our port
The fresh-books port passes 11/11 feature tests. Run on 2026-11-26 at MaxwellCohen/fresh-books@b6fe333. How we test labels
First-paint levers
- 01Production CSS inliningManual0 pts
Manual, like 11 of the other 22 frameworks. 11 frameworks score higher.
Show the how-toHide the how-to
No first-party CSS inlining documented. Vite bundles CSS imported from
client.ts; a per-routecssexport adds stylesheets. A Vite?inlineimport would be hand-wired (not found in the Fresh docs). (vite, file-routing)Code example
You import the stylesheet with Vite's
?inlinesuffix in_app.tsxand render it in a<style>tag. Drop the import fromclient.tsso Vite stops adding the<link>.// routes/_app.tsx import globalCss from "../assets/global.css?inline"; import { define } from "../utils.ts"; export default define.page(function App({ Component }) { return ( <html lang="en"> <head> <meta charset="utf-8" /> {/* _app.tsx is server-only, so the CSS string never reaches an island bundle */} <style dangerouslySetInnerHTML={{ __html: globalCss }} /> {/* … */} </head> <body f-client-nav>{/* … */}</body> </html> ); }); // client.ts // import "./assets/global.css"; ← removed, or the <link> comes backSource: Vite: disabling CSS injection
- 02Font optimizationThird-party1 pt
Third-party, like 18 of the other 22 frameworks. 4 frameworks score higher.
Show the how-toHide the how-to
No first-party font handling documented; fonts appear only as files in
static/referenced by URL. The third-party route is Fontsource packages, which the Fresh docs do not mention. (static-files)Code example
The Books port self-hosts Geist with Fontsource packages mapped in
deno.json. The CSS@importbrings in the@font-facerules, and Vite bundles the font files whenclient.tsimports the stylesheet.// deno.json "imports": { "@fontsource-variable/geist": "npm:@fontsource-variable/geist@^5.3.0" }/* assets/global.css (imported from client.ts) */ @import '@fontsource-variable/geist'; @import 'tailwindcss'; @theme { --font-sans: 'Geist Variable', ui-sans-serif, system-ui, sans-serif; }Source: Fontsource: Install
- 03Image pipelineThird-party1 pt
Third-party, like 13 of the other 22 frameworks. 9 frameworks score higher.
Show the how-toHide the how-to
The docs say there is no built-in optimization pipeline and suggest
vite-imagetoolsor a CDN. Fresh adds long-lived cache headers tosrc/srcset(opt out withdata-fresh-disable-lock);asset()/assetSrcSet()exist infresh/runtime. (static-files, api-reference)Code example
Fresh 2 builds with Vite, so
vite-imagetoolsresizes and converts images at build time. The query string on the import picks widths and format, andas=srcsetreturns a readysrcsetstring.// vite.config.ts import { defineConfig } from "vite"; import { fresh } from "@fresh/plugin-vite"; import { imagetools } from "vite-imagetools"; export default defineConfig({ plugins: [fresh(), imagetools()], });// routes/about.tsx import heroAvif from "../static/hero.jpg?format=avif&w=800"; import heroSrcset from "../static/hero.jpg?w=400;800;1200&format=webp&as=srcset"; export default function About() { return <img src={heroAvif} srcset={heroSrcset} sizes="100vw" alt="Shelves of books" width={800} />; }Source: Fresh: Static files
Art direction with <picture>
ManualServing a different crop or format per screen size. Not scored: the label shows how much the framework does for you.
No first-party
<picture>component documented; the docs point tovite-imagetoolsor a CDN, with markup hand-written. (static-files)Example
You write the
<picture>markup in a Preact component and put each pre-encoded format and crop instatic/yourself.// components/Hero.tsx export function Hero() { return ( <picture> <source media="(min-width: 1000px)" type="image/avif" srcset="/hero-wide.avif" /> <source media="(min-width: 1000px)" srcset="/hero-wide.jpg" /> <source type="image/avif" srcset="/hero-tall.avif" /> <img src="/hero-tall.jpg" alt="Shelves of books" width={750} height={1334} fetchPriority="high" decoding="async" /> </picture> ); }Source: Fresh static files
- 04Data/HTML cachingManual0 pts
Manual, like 4 of the other 22 frameworks. 18 frameworks score higher.
Show the how-toHide the how-to
No first-party cache documented; set
Cache-Controlby hand viapage(data, { headers }). Build-time prerender exists only as an open, unmerged PR, not in the docs and not credited. (data-fetching, 3766)Code example
You wrap each query in a TTL cache backed by a host store, and set the HTML Cache-Control in app middleware. This comes from the port.
// lib/catalog-cache.server.ts export function withTtlCache<Args extends unknown[], Result>( name: string, fn: (...args: Args) => Promise<Result>, ): (...args: Args) => Promise<Result> { // in-memory Map → Workers KV / Vercel getCache / Netlify Blobs → fn() return (...args: Args) => cacheLifeHours(`${name}:${JSON.stringify(args)}`, () => fn(...args)) } // features/book/book-queries.server.ts export const getBooksPage = withTtlCache('getBooksPage', getBooksPageUncached) // main.ts app.use(async (ctx) => { const res = await ctx.next(); if (!res.headers.get("content-type")?.includes("text/html")) return res; const headers = new Headers(res.headers); headers.set("Cache-Control", hostDocumentCacheControl()); return new Response(res.body, { status: res.status, statusText: res.statusText, headers }); });Source: Fresh data fetching
- 05Route prefetchingManual0 pts
Manual, like 2 of the other 22 frameworks. 20 frameworks score higher.
Show the how-toHide the how-to
No first-party prefetch documented; partials (
f-client-nav,f-partial) fetch on click only. (partials)Code example
Add a Speculation Rules block to
_app.tsx. Supporting browsers prefetch same-origin pages on hover, and other browsers ignore it. The prefetch only helps full-page navigations, so it does not speed up links that use Fresh partials (f-client-nav).// routes/_app.tsx const speculationRules = JSON.stringify({ prefetch: [{ where: { and: [ { href_matches: "/*" }, { not: { selector_matches: "[rel~=nofollow]" } }, ] }, eagerness: "moderate", }], }); // … inside <head>: <script type="speculationrules" dangerouslySetInnerHTML={{ __html: speculationRules }} />Source: MDN: speculationrules
- 06Streaming SSRManual0 pts
Manual, like 2 of the other 22 frameworks. 20 frameworks score higher.
Show the how-toHide the how-to
No streamed page rendering documented. The docs show a
ReadableStreamreturned from an API handler only, and describe no way to flush part of a page early. (common-patterns, data-fetching)Code example
Write the route handler yourself and return a
ReadableStreamof HTML. The shell and a placeholder go out first. When the query resolves, the handler sends the rendered grid and a small script that swaps it in. This page skips Fresh's layouts and islands.// routes/books.tsx import { define } from "@/utils.ts"; import { renderToString } from "preact-render-to-string"; export const handler = define.handlers({ GET() { const enc = new TextEncoder(); const body = new ReadableStream({ async start(controller) { controller.enqueue(enc.encode( `<!doctype html><html><head><link rel="stylesheet" href="/styles.css"></head>` + `<body><main id="grid">Loading…</main>`, )); const books = await getBooks(); controller.enqueue(enc.encode( `<template id="grid-html">${renderToString(<BookGrid books={books} />)}</template>` + `<script>document.getElementById("grid").replaceWith(document.getElementById("grid-html").content)</script></body></html>`, )); controller.close(); }, }); return new Response(body, { headers: { "Content-Type": "text/html; charset=utf-8" } }); }, });Source: Fresh: Common patterns
- 07Early Hints / preload headersManual0 pts
Manual, like 15 of the other 22 frameworks. 7 frameworks score higher.
Show the how-toHide the how-to
No first-party preload
Linkheaders or 103 Early Hints documented. Set aLinkheader by hand throughpage(data, { headers })or a middleware. (data-fetching)Code example
Set a
Linkheader on HTML responses in an app middleware. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.// main.ts const LINK = '<https://fonts.gstatic.com>; rel=preconnect; crossorigin'; app.use(async (ctx) => { const res = await ctx.next(); if (res.headers.get('content-type')?.includes('text/html')) res.headers.append('Link', LINK); return res; });Source: Fresh middleware
Other features
- 08Islands / partial hydration / lazy slices1st-party2 pts
1st-party, like 14 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Islands are the core model: only island JS ships and bundles are code-split; files live in
islands/or(_islands); props must be serializable. No lazy/idle/visible hydration timing is documented; Preactlazy()+<Suspense>is documented for code-splitting an island. (islands, architecture, common-patterns)Code example
Any component in
islands/ships JS; everything else renders to HTML only. In the Books port the layout is server-only, and just the search box and the mobile drawer hydrate.// routes/_layout.tsx import BookSearch from '@/islands/BookSearch.tsx'; import MobileSidebar from '@/islands/MobileSidebar.tsx'; import MobileSidebarTrigger from '@/islands/MobileSidebarTrigger.tsx'; import { define } from '../utils.ts'; export default define.layout(function Layout({ Component, url }) { const current = searchParamsFromUrl(url.searchParams); return ( <> <MobileSidebar pathname={url.pathname}> {/* server-rendered children passed into an island */} <BookSidebar current={current} idPrefix="mobile" mobile /> </MobileSidebar> <header> <MobileSidebarTrigger /> <BookSearch current={current} /> </header> <main><Component /></main> </> ); });Source: Fresh: Islands
- 09Per-route render modesManual0 pts
Manual, like 3 of the other 22 frameworks. 19 frameworks score higher.
Show the how-toHide the how-to
Pages render to HTML on the server; no per-route prerender/SPA/ISR option is documented (
RouteConfigcoversrouteOverride,skipAppWrapper,skipInheritedLayouts,cspandmethods; none selects a render mode). No first-party per-route render mode documented. (architecture, routing, file-routing)Code example
Every route still renders on the server. You pick a mode per route with CDN Cache-Control headers in app middleware, adapting the port's
main.tsmiddleware.// main.ts const modes: Record<string, string> = { "/about": "public, s-maxage=31536000", // "static": cached until redeploy "/": "public, s-maxage=60, stale-while-revalidate=86400", // "ISR": revalidate each minute }; app.use(async (ctx) => { const res = await ctx.next(); if (!res.headers.get("content-type")?.includes("text/html")) return res; const headers = new Headers(res.headers); headers.set("Cache-Control", modes[ctx.url.pathname] ?? "private, no-store"); // SSR return new Response(res.body, { status: res.status, statusText: res.statusText, headers }); }); app.fsRoutes(); - 10Fine-grained client reactivity1st-party2 pts
1st-party, like 21 of the other 22 frameworks. None scores higher.
Show the how-toHide the how-to
Preact signals (
useSignalfrom@preact/signals, a dependency of@fresh/coreand part of the@fresh/initscaffold). Fresh serializes signal props so islands share state. (signals, sharing-state-between-islands)Code example
Preact signals. In the Books port, one module-level signal is shared by two islands: the trigger sets it and the drawer re-renders when it changes.
// lib/catalog-nav.ts import { signal } from '@preact/signals'; export const mobileSidebarOpen = signal(false);// islands/MobileSidebarTrigger.tsx import { mobileSidebarOpen } from '@/lib/catalog-nav.ts'; export default function MobileSidebarTrigger() { return <button aria-label="Open filters" onClick={() => (mobileSidebarOpen.value = true)}>Filters</button>; } // islands/MobileSidebar.tsx export default function MobileSidebar({ children }: { children?: ComponentChildren }) { const isOpen = mobileSidebarOpen.value; return <aside hidden={!isOpen}>{children}</aside>; }Source: Fresh: Signals
- 11Built-in bundle analysisThird-party1 pt
Third-party, like 18 of the other 22 frameworks. 2 frameworks score higher.
Show the how-toHide the how-to
No first-party analyzer documented; the Vite page mentions only
vite-plugin-inspectas a debugging aid. (vite)Code example
Fresh has no analyzer. The Vite page suggests
vite-plugin-inspectfor looking at transforms during dev; for bundle sizes, addrollup-plugin-visualizerand rundeno task build.// vite.config.ts import { defineConfig } from "vite"; import { fresh } from "@fresh/plugin-vite"; import inspect from "vite-plugin-inspect"; import { visualizer } from "rollup-plugin-visualizer"; export default defineConfig({ plugins: [ fresh(), inspect(), // dev UI at /__inspect visualizer({ filename: "stats.html", gzipSize: true }), ], });Source: Fresh: Vite
- 12Third-party script strategiesManual0 pts
Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.
Show the how-toHide the how-to
No first-party script primitive documented; the head page lists
<script>with no loading-strategy guidance. (head)Code example
You write the loading strategy into
<head>in_app.tsx. Useasyncordeferon the tag, or inject it at idle time with an inline script, as the port does for its theme script.// routes/_app.tsx const loadChatWhenIdle = `(window.requestIdleCallback||setTimeout)(function(){ var s=document.createElement("script");s.src="https://widget.example.com/chat.js";s.async=true; document.head.appendChild(s);});`; export default define.page(function App({ Component }) { return ( <html lang="en"> <head> {/* … */} <script async src="https://analytics.example.com/script.js" /> {/* parallel, non-blocking */} <script dangerouslySetInnerHTML={{ __html: loadChatWhenIdle }} /> {/* after load, at idle */} </head> {/* <head> sits outside <Partial>, so f-client-nav does not re-run these */} <body f-client-nav>{/* … */}</body> </html> ); });Source: Fresh head
- 13Portable multi-host deploymentManual0 pts
Manual, like 8 of the other 22 frameworks. 14 frameworks score higher.
Show the how-toHide the how-to
Documented: Deno Deploy,
deno compile, Docker, and Cloudflare Workers (via@cloudflare/vite-pluginand a hand-writtenserver.js; stability not stated). Node, Vercel, and Netlify are not documented; no official guide was found. (deployment, cloudflare-workers, docker, deno-deploy)Code example
You write a post-build script that wraps
_fresh/server.jsin each host's entry shape. This comes from the port: an edge function for Netlify, and a Node handler plus Build Output API config for Vercel.// scripts/netlify-edge.mjs import server from "../_fresh/server.js"; export default (request) => server.fetch(request); // scripts/adapt.mjs (runs after `vite build`; host picked by NETLIFY=1 | VERCEL=1) if (host === "vercel") { await build({ ...common, entryPoints: ["scripts/vercel-handler.mjs"], outfile: `${out}/functions/index.func/index.mjs`, platform: "node", target: "node24" }); await Deno.writeTextFile(`${out}/functions/index.func/.vc-config.json`, JSON.stringify({ runtime: "nodejs24.x", handler: "index.mjs", launcherType: "Nodejs", supportsResponseStreaming: true, })); // … copy _fresh/client to static/, write config.json routes } else if (host === "netlify") { await build({ ...common, entryPoints: ["scripts/netlify-edge.mjs"], outfile: "netlify/edge-functions/fresh.js", platform: "neutral", external: ["node:*"] }); }Source: Fresh deployment
- 14Service worker / offline supportManual0 pts
Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.
Show the how-toHide the how-to
No service worker support documented. Put a hand-written worker in
static/and register it from an island. (static-files)Code example
Put a hand-written worker in
static/and register it with an inline script in the app wrapper.// static/sw.js const CACHE = 'books-v1'; // change the name on each deploy self.addEventListener('activate', (event) => { event.waitUntil( caches.keys().then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))), ); }); self.addEventListener('fetch', (event) => { const { request } = event; if (request.method !== 'GET' || new URL(request.url).origin !== location.origin) return; // Network first, so pages stay current. The cached copy answers when offline. event.respondWith( fetch(request) .then((response) => { const copy = response.clone(); caches.open(CACHE).then((cache) => cache.put(request, copy)); return response; }) .catch(() => caches.match(request)), ); });// routes/_app.tsx const swScript = `if('serviceWorker' in navigator)addEventListener('load',function(){navigator.serviceWorker.register('/sw.js')});`; // … in <head> <script dangerouslySetInnerHTML={{ __html: swScript }} />
1st-party scores 2 points, Experimental and Third-party 1, Manual 0. How scoring works
The port
The books demo app built with this framework, and where each branch is deployed.
- App
- fresh-books
- Repository
- github.com/MaxwellCohen/fresh-books
Branch
main
vibe port
- Vercel
- fresh-books.vercel.app
- Netlify
- fresh-books.netlify.app
- Cloudflare
- fresh-books.to-email-max.workers.dev
Branch
optimized
cache + fonts
Latest benchmark
Mobile Lighthouse lab results from PageSpeed Insights on : the median of 3 runs per host, averaged across the hosts listed. The benchmark page explains each metric and has every other framework.
| Build | Path | Perf | FCP | Raw FCP | LCP | TBT | CLS | SI | TTI | Doc | Hosts |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Book list / | |||||||||||
| baseline | / | 84 | (good)1.51 | 0.95 | (poor)4.25 | (good)0 | (good)0.000 | 2.13 | 4.25 | 139 | 3/3 Vercel, Netlify, Cloudflare |
| optimized | / | 90 | (good)0.92 | 0.99 | (needs improvement)3.60 | (good)0 | (good)0.000 | 1.84 | 3.60 | 176 | 3/3 Vercel, Netlify, Cloudflare |
| Book page /10145787 | |||||||||||
| baseline | /10145787 | 97 | (good)1.51 | 0.31 | (good)2.49 | (good)0 | (good)0.000 | 1.54 | 2.49 | 153 | 3/3 Vercel, Netlify, Cloudflare |
| optimized | /10145787 | 100 | (good)0.87 | 0.63 | (good)1.81 | (good)0 | (good)0.000 | 1.39 | 1.81 | 135 | 3/3 Vercel, Netlify, Cloudflare |
- Good
- Needs improvement
- Poor
FCP 1.8 s / 3 s · LCP 2.5 s / 4 s · TBT 200 ms / 600 ms · CLS 0.1 / 0.25
Per host
The medians above before averaging. Runs is how many measured runs went into each median. Host names link to the deployment.
| Build | Path | Host | Perf | FCP | Raw FCP | LCP | TBT | CLS | SI | TTI | Doc | Runs | Status |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Fresh | |||||||||||||
| baseline | / | Vercel | 85 | (good)1.51 | 0.24 | (poor)4.05 | (good)0 | (good)0.000 | 1.51 | 4.05 | 100 | 3/3 | OK |
| baseline | / | Netlify | 84 | (good)1.51 | 1.30 | (poor)4.36 | (good)0 | (good)0.000 | 2.44 | 4.36 | 139 | 3/3 | OK |
| baseline | / | Cloudflare | 84 | (good)1.51 | 1.31 | (poor)4.36 | (good)0 | (good)0.000 | 2.45 | 4.36 | 177 | 3/3 | OK |
| baseline | /10145787 | Vercel | 97 | (good)1.51 | 0.29 | (needs improvement)2.56 | (good)0 | (good)0.000 | 1.54 | 2.56 | 112 | 3/3 | OK |
| baseline | /10145787 | Netlify | 97 | (good)1.51 | 0.33 | (good)2.44 | (good)0 | (good)0.000 | 1.54 | 2.44 | 123 | 3/3 | OK |
| baseline | /10145787 | Cloudflare | 97 | (good)1.51 | 0.31 | (good)2.47 | (good)0 | (good)0.000 | 1.54 | 2.47 | 223 | 3/3 | OK |
| optimized | / | Vercel | 90 | (good)0.91 | 0.22 | (needs improvement)3.60 | (good)0 | (good)0.000 | 0.91 | 3.60 | 129 | 3/3 | OK |
| optimized | / | Netlify | 89 | (good)0.96 | 2.37 | (needs improvement)3.61 | (good)0 | (good)0.000 | 3.71 | 3.61 | 167 | 3/3 | OK |
| optimized | / | Cloudflare | 90 | (good)0.91 | 0.39 | (needs improvement)3.60 | (good)0 | (good)0.000 | 0.92 | 3.60 | 232 | 3/3 | OK |
| optimized | /10145787 | Vercel | 100 | (good)0.91 | 0.24 | (good)1.80 | (good)0 | (good)0.000 | 0.91 | 1.80 | 89 | 3/3 | OK |
| optimized | /10145787 | Netlify | 100 | (good)0.78 | 0.23 | (good)1.81 | (good)0 | (good)0.000 | 0.78 | 1.81 | 57 | 3/3 | OK |
| optimized | /10145787 | Cloudflare | 99 | (good)0.93 | 1.41 | (good)1.82 | (good)0 | (good)0.000 | 2.47 | 1.82 | 259 | 3/3 | OK |