SPB Git forge

spb/rareindex

Public
54commits 1branches 0releases
7.1 MBsize
maindefault branch
10 days agolast push
TypeScript 61.9% HTML 37.2% SQL 0.7%

web: /data prerender budget (staticPageGenerationTimeout 240 s, hourly ISR) — build timed out at 60 s on 2M-row aggregates

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Simon-Pierre Boucher committed 16 days ago (Sep 8, 2026) parent 6c48aa5

2 changed files +5 −1

modified apps/web/next.config.ts +2 −0
@@ -29,6 +29,8 @@ const nextConfig: NextConfig = {
29 29 remotePatterns: [{ protocol: 'https', hostname: '**' }],
30 30 formats: ['image/avif', 'image/webp'],
31 31 },
32 + // Static pages query a large database; give the prerender workers room (default 60 s).
33 + staticPageGenerationTimeout: 240,
32 34 experimental: {
33 35 optimizePackageImports: ['lucide-react'],
34 36 // The image cache core is shared with the worker (workers/image-processing/core.ts) via a relative re-export.
modified apps/web/src/app/data/page.tsx +3 −1
@@ -1,4 +1,5 @@
1 1 import type { Metadata } from 'next';
2 +
2 3 import Link from 'next/link';
3 4 import { readFile } from 'node:fs/promises';
4 5 import path from 'node:path';
@@ -11,7 +12,8 @@ import { fmtNum, fmtRelative, cn } from '@/lib/format';
11 12 import { catName, humanize } from '@/lib/taxonomy';
12 13
13 14 export const metadata: Metadata = { title: 'Data & methodology', description: 'Coverage by category, source and connector; RareIndex methodology; exports and API access.' };
14 export const revalidate = 300;
15 +// Coverage aggregates over millions of rows take ~70 s: prerender at build (staticPageGenerationTimeout raised), then hourly ISR.
16 +export const revalidate = 3600;
15 17
16 18 async function loadMethodology(): Promise<string> {
17 19 const candidates = [path.resolve(process.cwd(), '../../docs/METHODOLOGY.md'), path.resolve(process.cwd(), 'docs/METHODOLOGY.md'), path.resolve(process.cwd(), '../docs/METHODOLOGY.md')];
18 20