# [LLM optimization for websites: cut what the model must read](https://rebilder.com/solutions/llm-optimization)

> Optimising a website for LLMs is a token-cost problem: fewer bytes, facts near the top, no JavaScript needed. What to change, and what it saves.

- **Updated:** 2026-08-17

This page is about optimising a website so language models can use it, not about quantising a model. If you came looking for inference cost, this is the other meaning of the phrase.



## What you get

- A concrete definition of what "optimised for LLMs" means
- The four properties that decide whether you are used
- Measured byte and token reductions from two real captures
- A free scan that reports all four for any URL

## What optimising for an LLM actually means

A language model consuming your page is not browsing. It issues one HTTP request, receives bytes, converts them to tokens, and spends part of a finite context window on the result. Optimisation is therefore mostly subtraction: sending the same facts in far fewer tokens, with the important ones first.

| Property | Why it decides the outcome | How to check it |
| --- | --- | --- |
| Fetchable | A blocked request cannot be optimised | Request the URL as an agent would |
| Parseable without JS | The fetch runs no JavaScript | Read the raw response, not the DOM |
| Small | Context is finite and shared | Compare bytes with and without negotiation |
| Front-loaded | Truncation and summarisation cut the tail | Find the offset of the first real fact |

## What subtraction is worth

On the reference document capture, a services page went from 13,581 bytes to 1,412 and its first fact moved from character 10,152 to line 8. On the commerce capture, a product page went from 91,226 bytes to 1,315 with the first fact moving from character 23,185 to line 4. The facts were identical in both cases; only the packaging changed.

The two are quoted separately on purpose. A product page and a services page carry different amounts of chrome, so there is no honest single number between them, and a vendor quoting one average across all site types is telling you about their sample rather than about yours.

## How the subtraction happens

Content negotiation, done at the edge. A request asking for markdown receives markdown assembled from values you already store; browsers and search crawlers receive exactly what they received before.

middleware.ts

```ts
import { gateway } from '@rebilder/gateway'

export default gateway({
  source: { kind: 'document', resolve: myPages },
})
```

> **No model runs at request time** Page substance is never generated. The renderer prints stored values and the validator rejects a variant containing a number that did not come from a source field, so an "optimised" page cannot quietly invent a price.

## What this does not do

- It is not model optimisation. Nothing here quantises, distills, fine-tunes or reduces inference cost; that is the other meaning of the phrase.
- It cannot make an assistant mention you. Assistants are not deterministic and no vendor controls their output, so a guaranteed citation is not a thing anyone can sell.
- It does not change what Google sees. Content negotiation returns the same substance in another format, and search crawlers keep receiving canonical HTML.
- It does not rewrite your prose. Cutting markup is not editing, and if a fact is missing from your source of truth it stays missing.

## What is LLM optimization?

In a website context, making pages that language models can retrieve and afford to read: reachable without a blocked fetch, parseable without JavaScript, small in tokens, and front-loaded with the facts. In a machine-learning context the same phrase means making models cheaper to run, which is unrelated.

## How do I optimize my website for LLMs?

Check that agent fetches are not blocked, serve the facts without requiring JavaScript, answer `Accept: text/markdown` so the response is a fraction of the HTML size, and move the first substantive fact to the top of each template.

## How many tokens should a page be?

Fewer than it is now, in almost every case. There is no universal target because pages differ; the useful measurement is your own before-and-after, since that is the number that reflects your templates rather than someone else’s sample.

## Does this require changing my CMS?

No. It runs as middleware in front of whatever you already have, and the SDK is free, unmetered and self-hostable with no framework dependency in the core.

## Related

- [LLM visibility](https://rebilder.com/solutions/llm-visibility)
- [LLM SEO: what transfers from SEO](https://rebilder.com/learn/llm-seo)
- [AI content optimization](https://rebilder.com/solutions/ai-content-optimization)
- [llms.txt: what it is and whether it works](https://rebilder.com/learn/llms-txt)
- [Gateway quickstart](https://rebilder.com/docs/quickstart)