Don't Ship 25,000 Quiz Answers at Once: Split, Cache, and Prefetch
A quiz that ships its entire 25,000-answer bank before the first question wastes bandwidth and slows first render; splitting and prefetching keep a timed answer game responsive without forcing validation server-side.
An online quiz with 300+ questions and 25,000+ compiled answers cannot reasonably push the whole answer bank to the browser before the first question. One JSON file with everything is the simplest option: no extra requests after download, but first-screen download, JSON parsing, and memory use all grow with the data. The metric that matters is compressed transfer size, parse time, and runtime memory, not raw answer count.
Two split strategies reduce the initial payload. Category-based files, such as animals.json and geography.json, load only what a player enters and cache it for reuse, at the cost of cache memory and the need for limits, version updates, and retry handling. A separate question index plus per-question answer files decouples "what question comes next" from "which answers are valid", but creates more requests when switching questions.
A 25-second-per-question format makes network latency part of gameplay, so prefetching the next question's answer data matters. When the compressed bank is only tens of KB, bundling is good enough; multi-MB banks justify splitting or server-side validation. The order of work is measure first, then split, cache, prepare current question data before the timer starts, and prefetch.
Category splitting only helps when a player actually stays inside one category; a quiz that draws from all categories across questions still ends up fetching many files.
The 25-second timer turns answer loading into a latency problem, so prefetching can matter more than shaving payload size.
Keeping the full answer bank off the client ultimately pushes validation to the server, which hides the data but puts network round-trips inside the answer-check path.
Static file organization can solve most of this problem; state management and databases are not needed just because the dataset is large.
Splitting by question is exactly the right approach — stuffing 25,000+ answers into the initial load is just making trouble for yourself. Putting answer validation on the server also gets to the root of it; the frontend only needs to handle display.