Prebaked
Docs

How Prebaked works

Last reviewed

When a crawler asks for one of your pages, a small integration in front of your site sends the request to Prebaked. Prebaked answers with a fully rendered copy of the page from its cache, or renders it in a real browser. People never touch Prebaked: they get your site as it is.

The request flow

Who asks What happens
A person in a browser Your integration passes the request straight to your site. Prebaked is not called.
A crawler (Googlebot, GPTBot, ClaudeBot and others) Your integration calls https://service.prebaked.io/<page URL> with your domain token. Prebaked returns the rendered page.
A request for a static file (.js, .css, images, fonts), a method other than GET or HEAD, or a request with an X-Prerender header Your site answers. Prebaked is not called.

Inside Prebaked, each crawler request goes through these steps:

  1. Check the token and the domain. The token must belong to the domain, and the domain must be verified. Otherwise Prebaked answers 401 or 403.
  2. Look in the cache. Each page is cached by its normalised URL.
  3. Answer:
    • Fresh copy: returned right away.
    • Stale copy: returned right away, and a new render is queued.
    • No copy yet: Prebaked renders the page and waits up to 12 seconds for it.

How a page is rendered

Prebaked opens your page in Chromium, in a new and empty browser session for every render. No cookies or storage are kept between renders.

  • The page is ready when it sets window.prerenderReady = true. If it does not use that flag, the page is ready when it has loaded and the network has been quiet for 500 ms.
  • A render can take at most 15 seconds.
  • Images, video, audio and fonts are not downloaded, and known analytics and ad hosts are blocked. This keeps renders fast and does not change your HTML.
  • Prebaked's own requests to your site carry the header X-Prerender: 1, so your integration does not send them back to Prebaked.

The crawler gets your page's own HTTP status. A 404 stays a 404, and a redirect is passed on with its Location header. A page can also set its status with <meta name="prerender-status-code" content="404">.

Freshness and stale-while-revalidate

Each domain has a refresh interval. The default is 24 hours, and the fastest your plan allows is 24 hours on Starter, 12 hours on Growth and 3 hours on Pro.

  • A cached copy younger than the interval is fresh.
  • An older copy is stale. Prebaked still sends it to the crawler at once, then renders the page again in the background. The next crawler gets the new copy.

Crawlers never wait for a refresh. Cache hits are free and do not count as renders. See pricing for the plan limits.

Fallback to your own page

Prebaked is built so that crawlers are never worse off than without it.

  • First render too slow: if a page is not rendered within 12 seconds, Prebaked fetches your page without running JavaScript and returns it with your page's status. This is not billed. The render keeps going and fills the cache for the next crawler.
  • Prebaked slow or down: the Cloudflare Worker, Netlify, Vercel and nginx integrations serve your own page when Prebaked does not answer within 5 seconds, cannot be reached, or answers with an error (400, 401, 403, 5xx). Crawlers never see a Prebaked error page.
  • Express: the official prerender-node middleware passes Prebaked errors to the crawler and has no timeout. Add its afterRender hook to get the same fallback.

Same content for crawlers and people

Prebaked renders the page your visitors get and sends that HTML to crawlers. It does not add, remove or rewrite content for crawlers. The prerender-status-code meta tags stay in the HTML too. Serving crawlers the same content people see is not cloaking. Showing them different content would be, and Prebaked does not do that.

FAQ

Do people ever get the Prebaked copy?

No. Your integration only calls Prebaked for known crawler user agents. Everyone else gets your site directly.

What happens the first time a crawler asks for a page?

Prebaked renders it and waits up to 12 seconds. If that is not enough, the crawler gets your own page and the finished render is cached for the next request.

Does a crawler visit count as a render?

Only when Prebaked renders the page: a first visit, a refresh of a stale copy, or a recache. Serving a cached copy is free.

What happens if Prebaked is slow or down?

Crawlers get your own page. The Cloudflare Worker, Netlify, Vercel and nginx integrations fall back when Prebaked does not answer within 5 seconds, cannot be reached or answers with an error. With Express, add the afterRender hook.