Look at the Nuxt documentation to learn more.
Make sure to install dependencies:
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun installStart the development server on http://localhost:3000:
# npm
npm run dev
# pnpm
pnpm dev
# yarn
yarn dev
# bun
bun run devBuild the application for production:
# npm
npm run build
# pnpm
pnpm build
# yarn
yarn build
# bun
bun run buildLocally preview production build:
# npm
npm run preview
# pnpm
pnpm preview
# yarn
yarn preview
# bun
bun run previewCheck out the deployment documentation for more information.
The site is server-rendered by a Pages Function, which is billed as Workers CPU time. A few things keep that bill in check; please keep them that way:
routeRulesinnuxt.config.tshas noisr/swr/cacheentry. Nitro'sisris only implemented for Vercel/Netlify, and any of these options makes Nuxt extract the page payload into a separate/_payload.jsonrequest, which is answered by a second full server render on every page view (and the first render also has to serialise and keep the whole payload in memory for it).- Large JSON (the version manifest, the version list and the per-version
_index.jsonused by the search dialog) is fetched client-side only (server: false). Fetching it during SSR means parsing and serialising megabytes of JSON on every render. - Nothing logs the render payload on the server.
console.logof large objects costs CPU and Workers Logs events on every request. - Rendered HTML is sent with
Cache-Control: public, max-age=300, s-maxage=3600(set inserver/plugins/cache-headers.ts, for successfully rendered pages only). Cloudflare does not cache HTML by default, so to actually serve repeat page views from the edge add a Cache Rule for themcasset.cloudzone: match hostnamemcasset.cloud, set Eligible for cache, and let the edge TTL follow the originCache-Controlheader.