A 50 euro lesson in prerendering

I got an invoice from Vercel for 50 euros. I will survive. But it is the kind of bill that only arrives when you forgot to think, so here is what I forgot.

The setup

The Vocabbie website used to be a small marketing page. Then it grew a blog, then generated pages, and now it has around 11,000 URLs. I had it on pay-as-you-go and never changed how pages rendered. Every one of those URLs was being rendered on request, on a serverless function, every time a crawler or a person hit it.

Crawlers hit it a lot. Eleven thousand pages times a month of bots is a lot of function invocations for content that changes roughly never.

The fix

Prerender everything that does not need to be live. In SvelteKit that is one line per route, or one line in the root layout if you want the whole site static:

export const prerender = true;

Build it once, serve files from the CDN, pay nothing per request. The pages that actually need server work (a form, a search) stay dynamic. Everything else becomes HTML on disk.

The lesson

The mental model of “it is just my website” stopped being true and I did not update it. When a site crosses from a few pages to thousands, hosting decisions that used to be irrelevant start to matter. Check the rendering mode before the invoice does.

Fifty euros is cheap tuition. I have paid more for worse lessons.