# Early Hints / preload headers

Feature 7 of 14, in the group "First-paint levers". Labels across 23 meta-frameworks: 4 1st-party, 3 Experimental, 0 Third-party, 16 Manual.

## What it is and why it matters

A `Link: </assets/app.css>; rel=preload; as=style` response header names a critical asset before the browser has parsed any HTML. A `103 Early Hints` response sends those `Link` headers while the server is still rendering, so the stylesheet, font, and script requests start during the server's think time. The row is ✅ when the framework adds preload `Link` headers for its own built assets, or sends the 103 itself, without the app listing assets by hand. Setting a `Link` header through a generic headers API is 🔧. A CDN such as Cloudflare can turn a cached `Link` header into a 103 ([Cloudflare Early Hints](https://developers.cloudflare.com/cache/advanced-configuration/early-hints/)), which is why preload headers count here even when the framework never writes a 103.

## Gotchas

- Browsers act on a 103 only over HTTP/2 or HTTP/3, and some proxies mistake a 103 for the final response. Pracht keeps `earlyHints` off by default for that reason.
- Nginx and Apache cap header size, and a long `Link` header can be truncated or rejected. SvelteKit keeps `linkHeaderPreload` off by default and Next caps the length for the same reason.
- A static 103 can go out before a route decides to redirect. TanStack's `dynamic` phase waits for the loaders to avoid that.
- Styles that are already inlined need no preload. Pracht sends no `Link` header for `inlineCss` styles.

## Labels

| Framework | Label | Points |
| --- | --- | --- |
| [Next](https://framework-compare.vercel.app/frameworks/next.md) | 1st-party | 2 |
| [Nuxt](https://framework-compare.vercel.app/frameworks/nuxt.md) | Experimental | 1 |
| [SvelteKit](https://framework-compare.vercel.app/frameworks/sveltekit.md) | 1st-party | 2 |
| [SolidStart](https://framework-compare.vercel.app/frameworks/solidstart.md) | Manual | 0 |
| [TanStack Start (React)](https://framework-compare.vercel.app/frameworks/tanstack-start-react.md) | Experimental | 1 |
| [TanStack Start (Solid)](https://framework-compare.vercel.app/frameworks/tanstack-start-solid.md) | Experimental | 1 |
| [Pracht](https://framework-compare.vercel.app/frameworks/pracht.md) | 1st-party | 2 |
| [Waku](https://framework-compare.vercel.app/frameworks/waku.md) | Manual | 0 |
| [Ember](https://framework-compare.vercel.app/frameworks/ember.md) | Manual | 0 |
| [Astro](https://framework-compare.vercel.app/frameworks/astro.md) | Manual | 0 |
| [React Router](https://framework-compare.vercel.app/frameworks/react-router.md) | Manual | 0 |
| [Qwik City](https://framework-compare.vercel.app/frameworks/qwik-city.md) | Manual | 0 |
| [Angular (SSR)](https://framework-compare.vercel.app/frameworks/angular.md) | Manual | 0 |
| [Marko](https://framework-compare.vercel.app/frameworks/marko.md) | Manual | 0 |
| [Fresh](https://framework-compare.vercel.app/frameworks/fresh.md) | Manual | 0 |
| [Analog](https://framework-compare.vercel.app/frameworks/analog.md) | Manual | 0 |
| [Vike](https://framework-compare.vercel.app/frameworks/vike.md) | 1st-party | 2 |
| [RedwoodSDK](https://framework-compare.vercel.app/frameworks/redwoodsdk.md) | Manual | 0 |
| [Remix 3](https://framework-compare.vercel.app/frameworks/remix.md) | Manual | 0 |
| [Void (React)](https://framework-compare.vercel.app/frameworks/void-react.md) | Manual | 0 |
| [Void (Vue)](https://framework-compare.vercel.app/frameworks/void-vue.md) | Manual | 0 |
| [Void (Svelte)](https://framework-compare.vercel.app/frameworks/void-svelte.md) | Manual | 0 |
| [Void (Solid)](https://framework-compare.vercel.app/frameworks/void-solid.md) | Manual | 0 |

## How to enable it in each framework

### Next

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

Nothing to enable in the App Router. During prerendering React emits preload headers for fonts, scripts, and stylesheets, and Next adds them to the response. [`reactMaxHeadersLength`](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactMaxHeadersLength) caps their total length (default 6000) for proxies that truncate long headers. Next does not document sending a 103 itself.

```js
module.exports = {
  reactMaxHeadersLength: 1000,
}
```

*From [the reactMaxHeadersLength docs](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactMaxHeadersLength).*

### Nuxt

Label: **Experimental** (1 of 2 points).

Set [`experimental.writeEarlyHints: true`](https://nuxt.com/docs/4.x/guide/going-further/experimental-features). Nuxt then writes a 103 with the page's preload links. The docs limit it to the Node server.

```ts
export default defineNuxtConfig({
  experimental: {
    writeEarlyHints: true,
  },
})
```

*From [the Nuxt experimental features docs](https://nuxt.com/docs/4.x/guide/going-further/experimental-features).*

### SvelteKit

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

Set [`output.linkHeaderPreload: true`](https://svelte.dev/docs/kit/@sveltejs-kit-vite#output) (SvelteKit 3.0+, default `false`). Pages that are not prerendered then preload their JS and CSS through the HTTP `Link` header instead of `<link>` elements. SvelteKit does not document sending a 103 itself.

```ts
sveltekit({
  output: {
    linkHeaderPreload: true,
  },
})
```

*Adapted from [the `output` config docs](https://svelte.dev/docs/kit/@sveltejs-kit-vite#output); the option sits next to `inlineStyleThreshold` in this repo's `svelte-books/vite.config.ts`, which does not set it.*

### SolidStart

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

No first-party preload headers or Early Hints are documented. [`httpHeader`](https://docs.solidjs.com/reference/solid-web/rendering-ssr/http-header) sets a response header during SSR, so you list each asset yourself.

```ts
httpHeader("Link", "</fonts/inter.woff2>; rel=preload; as=font", {
  append: true,
});
```

*From [the Solid `httpHeader` reference](https://docs.solidjs.com/reference/solid-web/rendering-ssr/http-header).*

### TanStack Start (React)

Label: **Experimental** (1 of 2 points).

[Early Hints](https://tanstack.com/start/latest/docs/framework/react/guide/early-hints) are marked experimental. Start collects route assets and route `head().links` and calls `onEarlyHints` in your server entry; your code sends the 103 with the runtime's own API, because "Start does not send Early Hints automatically". `responseLinkHeader` puts the same links in a `Link` header for a CDN to convert.

```tsx
// src/server.ts
import handler, { createServerEntry } from '@tanstack/react-start/server-entry'

export default createServerEntry({
  fetch(request) {
    return handler.fetch(request, {
      onEarlyHints: ({ phase, links }) => {
        if (phase !== 'static' || !links.length) return

        // Send `links` with your runtime-specific 103 API.
      },
    })
  },
})
```

*From [the TanStack Start Early Hints guide](https://tanstack.com/start/latest/docs/framework/react/guide/early-hints).*

### TanStack Start (Solid)

Label: **Experimental** (1 of 2 points).

The same experimental [`onEarlyHints`](https://tanstack.com/start/latest/docs/framework/solid/guide/early-hints) hook and `responseLinkHeader` option, imported from `@tanstack/solid-start/server-entry`.

Example of building it yourself:

Pass `onEarlyHints` to `handler.fetch()` in the server entry. It receives the manifest's preload links, which you send with the runtime's 103 API. `responseLinkHeader: true` puts them in a `Link` header instead.

```tsx
// src/server.ts
import handler from '@tanstack/solid-start/server-entry'
import type { ServerRequest } from 'srvx'

export default {
  fetch(request: Request) {
    const serverRequest = request as ServerRequest
    return handler.fetch(request, {
      onEarlyHints: ({ phase, allLinks }) => {
        if (phase !== 'dynamic') return
        const response = serverRequest.runtime?.node?.res
        if (response?.writeEarlyHints && allLinks.length) {
          response.writeEarlyHints({ link: allLinks })
        }
      },
    })
  },
}
```

Source: [TanStack Start: Early Hints](https://tanstack.com/start/latest/docs/framework/solid/guide/early-hints)

### Pracht

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

Nothing to enable for the header: rendered pages, and prerendered SSG/ISG pages on the Node, Cloudflare, Vercel, and Netlify adapters, send a preload `Link` header for their stylesheets ([performance guide, Early hints](https://pracht.resynapse.dev/docs/performance)). On the [Node adapter](https://pracht.resynapse.dev/docs/adapters/node), `earlyHints: true` sends the 103 itself, including the page's scripts, before the loaders run.

```ts
nodeAdapter({ earlyHints: true });
```

*From [the Pracht performance guide](https://pracht.resynapse.dev/docs/performance).*

### Waku

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

No first-party preload headers or Early Hints are documented on [waku.gg](https://waku.gg/). Add a `Link` header at the host or CDN.

Example of building it yourself:

Add a Hono middleware that sets a `Link` header on HTML responses. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

```ts
// src/middleware/link-header.ts
import type { MiddlewareHandler } from 'hono';

const LINK = '<https://fonts.gstatic.com>; rel=preconnect; crossorigin';

export default (): MiddlewareHandler => async (c, next) => {
  await next();
  if (c.res.headers.get('content-type')?.includes('text/html')) c.res.headers.set('Link', LINK);
};
```

Source: [Hono middleware](https://hono.dev/docs/guides/middleware)

### Ember

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

No first-party preload headers or Early Hints are documented in the [FastBoot user guide](https://ember-fastboot.com/docs/user-guide) or in [`vite-ember-ssr`](https://github.com/evoactivity/vite-ember-ssr). Set a `Link` header in the Node server that wraps the renderer, or at the host.

Example of building it yourself:

Set a `Link` header on the Fastify reply that sends the rendered page. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

```js
// server.js
const LINK = '<https://fonts.gstatic.com>; rel=preconnect; crossorigin';
// … in the handler that sends the SSR result
const { html } = await renderHtml(emberApp, request.url, template);
return reply.header('Link', LINK).type('text/html').send(html);
```

Source: [Fastify Reply: `.header()`](https://fastify.dev/docs/latest/Reference/Reply/#headerkey-value)

### Astro

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

No first-party preload `Link` headers or 103 Early Hints documented; the configuration reference has no option for either. Set a `Link` header by hand with `Astro.response.headers` or at the host. ([configuration-reference](https://docs.astro.build/en/reference/configuration-reference/), [on-demand-rendering](https://docs.astro.build/en/guides/on-demand-rendering/))

Example of building it yourself:

Set a `Link` header on HTML responses in the middleware. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

```ts
// src/middleware.ts
import { defineMiddleware } from 'astro:middleware'

const LINK = '<https://fonts.gstatic.com>; rel=preconnect; crossorigin'

export const onRequest = defineMiddleware(async (_context, next) => {
  const response = await next()
  if (!response.headers.get('content-type')?.includes('text/html')) return response
  const headers = new Headers(response.headers)
  headers.set('Link', LINK)
  return new Response(response.body, { status: response.status, statusText: response.statusText, headers })
})
```

Source: [Astro middleware](https://docs.astro.build/en/guides/middleware/)

### React Router

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

No first-party preload `Link` headers or 103 Early Hints documented. The route `headers` export can set a `Link` header by hand, with the asset URLs listed by the app. ([headers](https://reactrouter.com/how-to/headers))

Example of building it yourself:

Export `headers` from a route module and return a `Link` header. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

```tsx
// app/routes/home.tsx
export function headers() {
  return { Link: '<https://fonts.gstatic.com>; rel=preconnect; crossorigin' };
}
```

Source: [React Router: HTTP headers](https://reactrouter.com/how-to/headers)

### Qwik City

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

No first-party preload `Link` headers or 103 Early Hints documented; the preloader works through `<link rel="modulepreload">` tags in the HTML. Set a `Link` header by hand with `headers.set()` in a request handler. ([speculative-module-fetching](https://qwik.dev/docs/advanced/speculative-module-fetching/), [caching](https://qwik.dev/docs/caching/))

Example of building it yourself:

Set a `Link` header in the root layout's `onGet` handler. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

```tsx
// src/routes/layout.tsx
import type { RequestHandler } from '@builder.io/qwik-city'

export const onGet: RequestHandler = async ({ headers }) => {
  headers.set('Link', '<https://fonts.gstatic.com>; rel=preconnect; crossorigin')
}
```

Source: [Qwik City: caching and response headers](https://qwik.dev/docs/caching/)

### Angular (SSR)

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

No first-party preload `Link` headers or 103 Early Hints documented. Per-route `headers` in `ServerRoute` and `RESPONSE_INIT` can set a `Link` header by hand. ([ssr](https://angular.dev/guide/ssr))

Example of building it yourself:

Add a `Link` header to the server route's `headers`. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

```ts
// src/app/app.routes.server.ts
import { RenderMode, ServerRoute } from '@angular/ssr';

export const serverRoutes: ServerRoute[] = [
  {
    path: '**',
    renderMode: RenderMode.Server,
    headers: { Link: '<https://fonts.gstatic.com>; rel=preconnect; crossorigin' },
  },
];
```

Source: [Angular SSR: setting headers and status codes](https://angular.dev/guide/ssr)

### Marko

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

No first-party preload `Link` headers or 103 Early Hints documented. Handlers return web-standard `Response` objects, so a `Link` header is set by hand in a `+handler` or `+middleware` file. ([file-based-routing](https://markojs.com/docs/marko-run/file-based-routing))

Example of building it yourself:

Set a `Link` header on HTML responses in the root middleware. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

```ts
// src/routes/+middleware.ts
const LINK = '<https://fonts.gstatic.com>; rel=preconnect; crossorigin';

export default async (_ctx: unknown, next: () => Promise<Response>) => {
  const response = await next();
  if (response.headers.get('content-type')?.includes('text/html')) response.headers.append('Link', LINK);
  return response;
};
```

Source: [Marko Run: file-based routing](https://markojs.com/docs/marko-run/file-based-routing)

### Fresh

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

No first-party preload `Link` headers or 103 Early Hints documented. Set a `Link` header by hand through `page(data, { headers })` or a middleware. ([data-fetching](https://usefresh.dev/docs/concepts/data-fetching))

Example of building it yourself:

Set a `Link` header 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.

```ts
// 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](https://usefresh.dev/docs/concepts/middleware)

### Analog

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

No first-party preload `Link` headers or 103 Early Hints documented. Set a `Link` header by hand with h3 `setResponseHeader` in server middleware. ([middleware](https://analogjs.org/docs/features/routing/middleware))

Example of building it yourself:

Set a `Link` header by hand in server middleware. Files in `src/server/middleware/` are registered automatically.

```ts
// src/server/middleware/preload.ts
import { defineEventHandler, setResponseHeader } from 'h3';

export default defineEventHandler((event) => {
  if (event.path.startsWith('/api')) return;
  setResponseHeader(
    event,
    'Link',
    '<https://fonts.gstatic.com>; rel=preconnect; crossorigin, </media/hero-1280.avif>; rel=preload; as=image',
  );
});
```

Source: [Analog: Middleware](https://analogjs.org/docs/features/routing/middleware)

### Vike

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

Vike builds the list of a page's assets as `pageContext.httpResponse.earlyHints` (each entry has an `earlyHintLink` value), so the app does not list assets by hand. The server sends the 103 with its runtime's API, e.g. `res.writeEarlyHints({ link: earlyHints.map((e) => e.earlyHintLink) })` on Node 18+. Not marked experimental or beta. ([preloading](https://vike.dev/preloading))

Example of building it yourself:

`renderPage()` returns the page's assets in `pageContext.httpResponse.earlyHints`. Pass their `earlyHintLink` values to the runtime's 103 API before sending the body.

```ts
// server.ts
import { renderPage } from 'vike/server'

app.get('*', async (req, res) => {
  const pageContext = await renderPage({ urlOriginal: req.originalUrl })
  const { earlyHints } = pageContext.httpResponse
  // For example with Node.js 18:
  res.writeEarlyHints({ link: earlyHints.map((e) => e.earlyHintLink) })
  // … then send pageContext.httpResponse as usual
})
```

Source: [Vike: Preloading](https://vike.dev/preloading)

### RedwoodSDK

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/)

### Remix 3

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

No first-party preload `Link` headers or 103 Early Hints documented; the asset server returns module `preloads` that the document renders as `<link rel="modulepreload">` tags. Set a `Link` header by hand on the returned `Response`. ([assets](https://docs.remix.run/api/assets/), [files-and-assets](https://docs.remix.run/files-and-assets/))

Example of building it yourself:

There is no Early Hints API, so set a `Link` preload header yourself on the response the action returns.

```tsx
// app/actions/books/controller.tsx
import { assets, stylesheetHref } from "../../assets.ts";

// inside the show action:
let coverHref = await assets.getHref("app/ui/public/cover.jpg");

return context.render(<BookPage book={book} coverHref={coverHref} />, {
  headers: {
    Link: [
      `<${stylesheetHref}>; rel=preload; as=style`,
      `<${coverHref}>; rel=preload; as=image; fetchpriority=high`,
    ].join(", "),
  },
});
```

Source: [Remix: Rendering UI, rendering pages through request context](https://docs.remix.run/rendering-ui/#rendering-pages-through-request-context)

### Void (React)

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

No preload `Link` response headers or 103 Early Hints documented. `assetTags.preloads` puts `<link rel="modulepreload">` tags in the HTML `<head>`, not in headers. Set a `Link` header by hand with `routing.headers` or `c.header()`. ([handlers](https://void.cloud/reference/api/handlers), [headers](https://void.cloud/guide/edge/headers))

Example of building it yourself:

Void sends no 103 and no preload `Link` header. It only puts `<link rel="modulepreload">` tags in the HTML. Add the header yourself with `routing.headers`.

```ts
// void.config.ts
import { defineConfig } from 'void/config'

export default defineConfig({
  routing: { headers: { '/*': ['Link: </fonts/geist.woff2>; rel=preload; as=font; crossorigin'] } },
})
```

Source: [Void: Headers](https://void.cloud/guide/edge/headers)

### Void (Vue)

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

No preload `Link` response headers or 103 Early Hints documented. `assetTags.preloads` puts `<link rel="modulepreload">` tags in the HTML `<head>`, not in headers. Set a `Link` header by hand with `routing.headers` or `c.header()`. ([handlers](https://void.cloud/reference/api/handlers), [headers](https://void.cloud/guide/edge/headers))

Example of building it yourself:

Void sends no 103 and no preload `Link` header. It only puts `<link rel="modulepreload">` tags in the HTML. Add the header yourself with `routing.headers`.

```ts
// void.config.ts
import { defineConfig } from 'void/config'

export default defineConfig({
  routing: { headers: { '/*': ['Link: </fonts/geist.woff2>; rel=preload; as=font; crossorigin'] } },
})
```

Source: [Void: Headers](https://void.cloud/guide/edge/headers)

### Void (Svelte)

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

No preload `Link` response headers or 103 Early Hints documented. `assetTags.preloads` puts `<link rel="modulepreload">` tags in the HTML `<head>`, not in headers. Set a `Link` header by hand with `routing.headers` or `c.header()`. ([handlers](https://void.cloud/reference/api/handlers), [headers](https://void.cloud/guide/edge/headers))

Example of building it yourself:

Void sends no 103 and no preload `Link` header. It only puts `<link rel="modulepreload">` tags in the HTML. Add the header yourself with `routing.headers`.

```ts
// void.config.ts
import { defineConfig } from 'void/config'

export default defineConfig({
  routing: { headers: { '/*': ['Link: </fonts/geist.woff2>; rel=preload; as=font; crossorigin'] } },
})
```

Source: [Void: Headers](https://void.cloud/guide/edge/headers)

### Void (Solid)

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

No preload `Link` response headers or 103 Early Hints documented. `assetTags.preloads` puts `<link rel="modulepreload">` tags in the HTML `<head>`, not in headers. Set a `Link` header by hand with `routing.headers` or `c.header()`. ([handlers](https://void.cloud/reference/api/handlers), [headers](https://void.cloud/guide/edge/headers))

Example of building it yourself:

Void sends no 103 and no preload `Link` header. It only puts `<link rel="modulepreload">` tags in the HTML. Add the header yourself with `routing.headers`.

```ts
// void.config.ts
import { defineConfig } from 'void/config'

export default defineConfig({
  routing: { headers: { '/*': ['Link: </fonts/geist.woff2>; rel=preload; as=font; crossorigin'] } },
})
```

Source: [Void: Headers](https://void.cloud/guide/edge/headers)

---

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