# RedwoodSDK

RedwoodSDK scores 13 of 28 points on 14 speed features: 6/14 on first-paint levers and 7/14 on other features. Rank 19 of 23. Labels: 5 1st-party, 0 Experimental, 3 Third-party, 6 Manual.

- Version checked: rwsdk 1.7.5 (npm latest on 2026-11-25) (RedwoodSDK runs on Cloudflare Workers only; the Books port runs the same Worker bundle in a Node wrapper on Vercel and Netlify.)
- Performance guide: [React Compiler | RedwoodSDK Docs](https://docs.rwsdk.com/guides/optimize/react-compiler)
- Issue tracker: https://github.com/redwoodjs/sdk/issues
- Books demo port: [redwoodsdk-books](https://github.com/MaxwellCohen/redwoodsdk-books)

## Summary

| Feature | Group | Label | Points |
| --- | --- | --- | --- |
| [Production CSS inlining](https://framework-compare.vercel.app/features/css-inlining.md) | First-paint levers | Manual | 0 |
| [Font optimization](https://framework-compare.vercel.app/features/font-optimization.md) | First-paint levers | Third-party | 1 |
| [Image pipeline](https://framework-compare.vercel.app/features/image-pipeline.md) | First-paint levers | Third-party | 1 |
| [Data/HTML caching](https://framework-compare.vercel.app/features/caching.md) | First-paint levers | Manual | 0 |
| [Route prefetching](https://framework-compare.vercel.app/features/route-prefetching.md) | First-paint levers | 1st-party | 2 |
| [Streaming SSR](https://framework-compare.vercel.app/features/streaming-ssr.md) | First-paint levers | 1st-party | 2 |
| [Early Hints / preload headers](https://framework-compare.vercel.app/features/early-hints.md) | First-paint levers | Manual | 0 |
| [Islands / partial hydration / lazy slices](https://framework-compare.vercel.app/features/islands.md) | Other features | 1st-party | 2 |
| [Per-route render modes](https://framework-compare.vercel.app/features/render-modes.md) | Other features | 1st-party | 2 |
| [Fine-grained client reactivity](https://framework-compare.vercel.app/features/reactivity.md) | Other features | 1st-party | 2 |
| [Built-in bundle analysis](https://framework-compare.vercel.app/features/bundle-analysis.md) | Other features | Third-party | 1 |
| [Third-party script strategies](https://framework-compare.vercel.app/features/third-party-scripts.md) | Other features | Manual | 0 |
| [Portable multi-host deployment](https://framework-compare.vercel.app/features/multi-host-deployment.md) | Other features | Manual | 0 |
| [Service worker / offline support](https://framework-compare.vercel.app/features/service-worker.md) | Other features | Manual | 0 |

## First-paint levers

### Production CSS inlining

Label: **Manual** (0 of 2 points).

No first-party CSS inlining documented; the Document links a stylesheet imported with `?url` (`<link rel="stylesheet" href={styles} />`). Inline by hand. ([tailwind](https://docs.rwsdk.com/guides/frontend/tailwind), [documents](https://docs.rwsdk.com/guides/frontend/documents))

Example of building it yourself:

Import the stylesheet with Vite's `?inline` query instead of `?url`, and write it into a `<style>` in the Document. The Document renders only on the server, so the CSS string does not ship in a client bundle.

```tsx
// src/app/Document.tsx
import styles from "./styles.css?inline"; // was: import styles from "./styles.css?url";

export const Document: React.FC<{ children: React.ReactNode }> = ({ children }) => (
  <html lang="en">
    <head>
      <meta charSet="utf-8" />
      <title>RedwoodSDK App</title>
      {/* was: <link rel="stylesheet" href={styles} /> */}
      <style dangerouslySetInnerHTML={{ __html: styles }} />
      <link rel="modulepreload" href="/src/client.tsx" />
    </head>
    <body>
      {children}
      <script>import("/src/client.tsx")</script>
    </body>
  </html>
);
```

Source: [RedwoodSDK: Tailwind CSS](https://docs.rwsdk.com/guides/frontend/tailwind) · [Vite: disabling CSS injection](https://vite.dev/guide/features.html#disabling-css-injection-into-the-page)

### Font optimization

Label: **Third-party** (1 of 2 points).

No first-party font handling documented; the docs show font files in `public/fonts` with a hand-written `@font-face`. The third-party route is [Fontsource](https://fontsource.org). ([public-assets](https://docs.rwsdk.com/guides/frontend/public-assets))

Example of building it yourself:

Install a Fontsource package and import it at the top of the stylesheet. The package ships the `@font-face` rules and self-hosted font files, and Vite bundles them like any other CSS import.

```css
/* src/app/styles.css */
@import "@fontsource-variable/inter";
@import "tailwindcss";

@theme {
  --font-sans: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
}
```

Source: [Fontsource: Installing fonts](https://fontsource.org/docs/getting-started/install)

### Image pipeline

Label: **Third-party** (1 of 2 points).

No image component or optimizer documented; images are plain `<img>` tags served from `public/`. The third-party route is the host's [Cloudflare Images transformations](https://developers.cloudflare.com/images/transform-images/), wired by hand. ([public-assets](https://docs.rwsdk.com/guides/frontend/public-assets))

Example of building it yourself:

Turn on Cloudflare Images transformations for the zone, then build `/cdn-cgi/image/<OPTIONS>/<SOURCE>` URLs by hand. This helper writes a `srcSet` that asks Cloudflare for each width in the best format the browser accepts.

```tsx
// src/app/components/CfImage.tsx
const cf = (src: string, width: number) =>
  `/cdn-cgi/image/width=${width},quality=75,format=auto${src}`;

export function CfImage({ src, alt, width, height }: {
  src: string; alt: string; width: number; height: number;
}) {
  return (
    <img
      src={cf(src, width)}
      srcSet={[1, 2].map((d) => `${cf(src, width * d)} ${width * d}w`).join(", ")}
      sizes={`${width}px`}
      alt={alt} width={width} height={height} loading="lazy" decoding="async"
    />
  );
}
```

Source: [Cloudflare Images: Transform via URL](https://developers.cloudflare.com/images/transform-images/transform-via-url/)

Art direction with `<picture>` (Manual, not scored):

No first-party `<picture>` helper documented; hand-write the markup. ([public-assets](https://docs.rwsdk.com/guides/frontend/public-assets))

There is no image component, so write the `<picture>` by hand in a server component. Wide screens get a landscape crop and narrow screens get a square one, both served from `public/`. React spells the attribute `srcSet`.

```tsx
// src/app/components/Hero.tsx
export function Hero() {
  return (
    <picture>
      {/* art direction: a square crop on narrow screens */}
      <source media="(max-width: 640px)" srcSet="/images/hero-square-640.webp"
              width={640} height={640} />
      <source media="(min-width: 641px)" srcSet="/images/hero-wide-1600.webp"
              width={1600} height={900} />
      <img src="/images/hero-wide-1600.jpg" alt="Shelves of books"
           width={1600} height={900} fetchPriority="high" decoding="async" />
    </picture>
  );
}
```

Source: [MDN: the picture element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/picture) · [RedwoodSDK: Public Assets](https://docs.rwsdk.com/guides/frontend/public-assets)

### Data/HTML caching

Label: **Manual** (0 of 2 points).

No prerender, ISR or cache API documented; set `Cache-Control` by hand on the response headers. The client-navigation guide says RSC payload requests are GETs so browsers and CDNs can cache them. ([routing](https://docs.rwsdk.com/core/routing), [client-side-nav](https://docs.rwsdk.com/guides/frontend/client-side-nav))

Example of building it yourself:

Put a small handler in front of the page in the route's array and set `Cache-Control` on `response.headers`. The browser and Cloudflare's edge then cache the HTML for that route.

```tsx
// src/worker.tsx
import { defineApp } from "rwsdk/worker";
import { render, route } from "rwsdk/router";
import { Document } from "@/app/Document";
import { BookPage } from "@/app/pages/BookPage";

export default defineApp([
  render(Document, [
    route("/books/:id", [
      ({ response }) => {
        response.headers.set("Cache-Control", "public, max-age=60, s-maxage=300");
      },
      BookPage,
    ]),
  ]),
]);
```

Source: [RedwoodSDK: Request Handling, Routing & Responses](https://docs.rwsdk.com/core/routing)

### Route prefetching

Label: **1st-party** (2 of 2 points).

With client-side navigation on, `<link rel="x-prefetch" href="/about" />` makes RedwoodSDK fetch that route in the background after each navigation and store the response in the browser Cache API. Needs the `onHydrated` callback from `initClientNavigation()`. No hover or viewport trigger documented. ([client-side-nav](https://docs.rwsdk.com/guides/frontend/client-side-nav))

Example of building it yourself:

Turn on client navigation and pass `onHydrated` to `initClient`. Then render `<link rel="x-prefetch">` for likely next routes. RedwoodSDK fetches each one after navigation and keeps it in the Cache API.

```tsx
// src/client.tsx
import { initClient, initClientNavigation } from "rwsdk/client";

const { handleResponse, onHydrated } = initClientNavigation();
initClient({ handleResponse, onHydrated });
```

```tsx
// src/app/pages/BlogListPage.tsx
import { link } from "@/shared/links";

export function BlogListPage({ posts }) {
  return posts.map((post) => {
    const href = link("/blog/:slug", { slug: post.slug });
    return (
      <article key={post.id}>
        <link rel="x-prefetch" href={href} />
        <a href={href}><h2>{post.title}</h2></a>
      </article>
    );
  });
}
```

Source: [RedwoodSDK: Client Side Navigation](https://docs.rwsdk.com/guides/frontend/client-side-nav)

### Streaming SSR

Label: **1st-party** (2 of 2 points).

Server components are "rendered on the server as HTML and then streamed to the client". Wrap an async server component in `<Suspense fallback={...}>` to show a loading state while its data is fetched. Nothing to enable. ([react-server-components](https://docs.rwsdk.com/core/react-server-components))

Example of building it yourself:

Make a server component async and wrap it in `<Suspense>`. The page shell streams first with the fallback, and the list streams in when the query resolves.

```tsx
// src/app/pages/todos/TodoPage.tsx
import { Suspense } from "react";

export async function Todos({ ctx }) {
  const todos = await db.todo.findMany({ where: { userId: ctx.user.id } });
  return <ol>{todos.map((todo) => <li key={todo.id}>{todo.title}</li>)}</ol>;
}

export async function TodoPage({ ctx }) {
  return (
    <div>
      <h1>Todos</h1>
      <Suspense fallback={<div>Loading...</div>}>
        <Todos ctx={ctx} />
      </Suspense>
    </div>
  );
}
```

Source: [RedwoodSDK: React Server Components](https://docs.rwsdk.com/core/react-server-components)

### Early Hints / preload headers

Label: **Manual** (0 of 2 points).

No first-party preload `Link` headers or 103 Early Hints documented; the Document example hand-writes `<link rel="modulepreload" href="/src/client.tsx" />`. Set a `Link` header by hand with `requestInfo.response.headers` in middleware. ([documents](https://docs.rwsdk.com/guides/frontend/documents), [routing](https://docs.rwsdk.com/core/routing))

Example of building it yourself:

Add a middleware that sets a `Link` header on every response. This one preloads a font from `public/`, whose URL does not change between builds. Cloudflare can turn `Link` preload headers into 103 Early Hints when Early Hints is on for the zone.

```ts
// src/app/headers.ts
import type { RouteMiddleware } from "rwsdk/worker";

export const preloadHeaders = (): RouteMiddleware => ({ response }) => {
  response.headers.append(
    "Link",
    "</fonts/brand-font.woff2>; rel=preload; as=font; type=font/woff2; crossorigin",
  );
};

// src/worker.tsx
export default defineApp([
  preloadHeaders(),
  render(Document, [route("/", HomePage)]),
]);
```

Source: [RedwoodSDK: Security](https://docs.rwsdk.com/core/security) · [Cloudflare: Early Hints](https://developers.cloudflare.com/cache/advanced-configuration/early-hints/)

## Other features

### Islands / partial hydration / lazy slices

Label: **1st-party** (2 of 2 points).

React Server Components are the default; only components marked `"use client"` ship JavaScript and hydrate. ([react-server-components](https://docs.rwsdk.com/core/react-server-components))

Example of building it yourself:

Pages are server components by default and send no JavaScript. Only the component marked `"use client"` ships code and hydrates.

```tsx
// src/app/components/LikeButton.tsx
"use client";
import { useState } from "react";

export function LikeButton() {
  const [likes, setLikes] = useState(0);
  return <button onClick={() => setLikes(likes + 1)}>Like ({likes})</button>;
}

// src/app/pages/BookPage.tsx (server component, no client JS of its own)
import { LikeButton } from "@/app/components/LikeButton";

export async function BookPage({ params }) {
  const book = await getBook(params.id);
  return (
    <article>
      <h1>{book.title}</h1>
      <p>{book.description}</p>
      <LikeButton />
    </article>
  );
}
```

Source: [RedwoodSDK: React Server Components](https://docs.rwsdk.com/core/react-server-components)

### Per-route render modes

Label: **1st-party** (2 of 2 points).

`render(Document, routes, { ssr: false })` renders a group of routes on the client only, and `{ rscPayload: false }` serves a group as static HTML with no hydration. No build-time prerender documented. ([sdk-router](https://docs.rwsdk.com/reference/sdk-router))

Example of building it yourself:

Pass options as the third argument to `render()`. `rscPayload: false` serves a group as static HTML with no hydration, and `ssr: false` renders client components only in the browser.

```tsx
// src/worker.tsx
import { defineApp } from "rwsdk/worker";
import { render, prefix } from "rwsdk/router";
import { ReactDocument, StaticDocument } from "@/app/Document";

export default defineApp([
  // Default: SSR with the RSC payload, so the page hydrates
  render(ReactDocument, [prefix("/app", appRoutes)]),
  // Static HTML, no hydration (StaticDocument has no client script)
  render(StaticDocument, [prefix("/docs", docsRoutes)], { rscPayload: false }),
  // Client components render only in the browser
  render(ReactDocument, [prefix("/spa", spaRoutes)], { ssr: false }),
]);
```

Source: [RedwoodSDK: sdk/router](https://docs.rwsdk.com/reference/sdk-router)

### Fine-grained client reactivity

Label: **1st-party** (2 of 2 points).

React-based; the RedwoodSDK guide adds the first-party [React Compiler](https://react.dev/learn/react-compiler) as a Babel plugin on `@vitejs/plugin-react`, placed before the Cloudflare and RedwoodSDK plugins. ([react-compiler](https://docs.rwsdk.com/guides/optimize/react-compiler))

Example of building it yourself:

Add the React Compiler as a Babel plugin on `@vitejs/plugin-react`, placed before the Cloudflare and RedwoodSDK plugins. Components then get automatic memoization without `useMemo` or `useCallback`.

```ts
// vite.config.mts
import { defineConfig } from "vite";
import { redwood } from "rwsdk/vite";
import { cloudflare } from "@cloudflare/vite-plugin";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [
    react({
      babel: {
        plugins: ["babel-plugin-react-compiler"],
      },
    }),
    cloudflare({ viteEnvironment: { name: "worker" } }),
    redwood(),
  ],
});
```

Source: [RedwoodSDK: React Compiler](https://docs.rwsdk.com/guides/optimize/react-compiler)

### Built-in bundle analysis

Label: **Third-party** (1 of 2 points).

No first-party analyzer documented; RedwoodSDK is a Vite plugin, so the third-party route is a community visualizer such as [rollup-plugin-visualizer](https://github.com/btd/rollup-plugin-visualizer). ([hosting](https://docs.rwsdk.com/core/hosting))

Example of building it yourself:

RedwoodSDK builds with Vite, so add `rollup-plugin-visualizer` to the plugins. The build writes `stats.html` with a treemap of the bundles.

```ts
// vite.config.mts
import { defineConfig, type PluginOption } from "vite";
import { redwood } from "rwsdk/vite";
import { cloudflare } from "@cloudflare/vite-plugin";
import { visualizer } from "rollup-plugin-visualizer";

export default defineConfig({
  plugins: [
    cloudflare({ viteEnvironment: { name: "worker" } }),
    redwood(),
    visualizer({ filename: "stats.html", gzipSize: true }) as PluginOption,
  ],
});
```

Source: [rollup-plugin-visualizer: README](https://github.com/btd/rollup-plugin-visualizer)

### Third-party script strategies

Label: **Manual** (0 of 2 points).

No first-party script-loading strategy documented; scripts go in the Document by hand, and the security page covers only the CSP nonce they need. ([documents](https://docs.rwsdk.com/guides/frontend/documents), [security](https://docs.rwsdk.com/core/security))

Example of building it yourself:

Write the tags in the Document yourself. An external script gets `async`, and an inline snippet needs the per-request `rw.nonce` to pass the CSP. Add the script's host to `script-src` in `src/app/headers.ts`.

```tsx
// src/app/Document.tsx
export const Document = ({ rw, children }) => (
  <html lang="en">
    <head>
      {/* … */}
      <script async src="https://plausible.io/js/script.js" data-domain="books.example" />
    </head>
    <body>
      {children}
      <script nonce={rw.nonce}>
        {`window.plausible = window.plausible || function () { (plausible.q = plausible.q || []).push(arguments) };`}
      </script>
      <script>import("/src/client.tsx")</script>
    </body>
  </html>
);
```

Source: [RedwoodSDK: Security](https://docs.rwsdk.com/core/security) · [RedwoodSDK: Documents](https://docs.rwsdk.com/guides/frontend/documents)

### Portable multi-host deployment

Label: **Manual** (0 of 2 points).

Cloudflare Workers is the only documented host; no Node, Vercel or Netlify target is documented. ([hosting](https://docs.rwsdk.com/core/hosting))

Example of building it yourself:

The documented build targets Cloudflare Workers through `@cloudflare/vite-plugin`, and `pnpm release` deploys it. Staging and production are Wrangler environments. Another host would need an adapter you write yourself.

```ts
// vite.config.mts
import { defineConfig } from "vite";
import { redwood } from "rwsdk/vite";
import { cloudflare } from "@cloudflare/vite-plugin";

export default defineConfig({
  plugins: [cloudflare({ viteEnvironment: { name: "worker" } }), redwood()],
});
```

```bash
pnpm release                           # production Worker
CLOUDFLARE_ENV=staging pnpm release    # uses env.staging from wrangler.jsonc
```

Source: [RedwoodSDK: Hosting](https://docs.rwsdk.com/core/hosting)

### Service worker / offline support

Label: **Manual** (0 of 2 points).

No service worker support documented; the public assets guide shows only a `<link rel="manifest">` tag. Hand-write the worker in `public/` and register it from a client component. ([public-assets](https://docs.rwsdk.com/guides/frontend/public-assets))

Example of building it yourself:

Put a hand-written worker in `public/` and register it from a client component rendered on every page.

```js
// public/sw.js
const CACHE = "app-v1"; // change the name on each deploy

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)),
  );
});
```

```tsx
// src/app/components/RegisterServiceWorker.tsx
"use client";
import { useEffect } from "react";

export function RegisterServiceWorker() {
  useEffect(() => {
    if ("serviceWorker" in navigator) navigator.serviceWorker.register("/sw.js");
  }, []);
  return null;
}
```

Source: [Using Service Workers (MDN)](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) · [RedwoodSDK: Public Assets](https://docs.rwsdk.com/guides/frontend/public-assets)

## Other performance features

- Streaming responses from React server functions. ([rsc-streams](https://docs.rwsdk.com/guides/rsc-streams))
- Different Documents per route group, so one app can mix a static document, an SSR document and a client-only document. ([documents](https://docs.rwsdk.com/guides/frontend/documents))
- Security headers and a per-request CSP nonce by default. ([security](https://docs.rwsdk.com/core/security))

## Deployments of the Books demo

| Branch | Note | Vercel | Netlify | Cloudflare |
| --- | --- | --- | --- | --- |
| `main` | baseline | https://redwoodsdk-books.vercel.app | https://redwoodsdk-books.netlify.app | https://redwoodsdk-books.to-email-max.workers.dev |
| `optimized` | x-prefetch + fonts + catalog cache + cover preloads + asset headers | https://redwoodsdk-books-optimized.vercel.app | https://redwoodsdk-books-max-optimized.netlify.app | https://redwoodsdk-books-optimized.to-email-max.workers.dev |

## Benchmark, 2026-11-28

Tool: PageSpeed Insights v5 (Lighthouse lab run), mobile strategy. 3 measured runs per deployment, median reported; cold runs are left out of the median when a warm run exists. Each build's figure is the average of its hosts' medians (vercel, netlify, cloudflare). Pages measured: book list (/) and one book (/10145787). Times are lab values from one run on 2026-11-28. FCP is the Lighthouse estimate for simulated Slow 4G; Raw FCP, where shown, is the first paint in the real, unthrottled load that estimate is built from. Builds in the same FCP band (https://framework-compare.vercel.app/measured.md) are a tie, so read "fastest first" as band order.

| Page | Build | Branch | Hosts | Performance | FCP | Raw FCP | LCP | TBT | CLS |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| book list (/) | baseline | `main` | cloudflare, netlify, vercel | 83 | 1.52 s | 0.76 s | 4.56 s | 0 ms | 0.000 |
| book list (/) | optimized | `optimized` | cloudflare, netlify, vercel | 88 | 0.91 s | 0.31 s | 3.96 s | 0 ms | 0.001 |
| one book (/10145787) | baseline | `main` | cloudflare, netlify, vercel | 94 | 1.51 s | 1.01 s | 2.98 s | 0 ms | 0.000 |
| one book (/10145787) | optimized | `optimized` | cloudflare, netlify, vercel | 96 | 1.01 s | 1.29 s | 2.63 s | 0 ms | 0.000 |

Full run: https://framework-compare.vercel.app/benchmark.md

---

HTML version: https://framework-compare.vercel.app/frameworks/redwoodsdk · All pages: https://framework-compare.vercel.app/llms.txt · Data: https://framework-compare.vercel.app/api/index.json
