How GitBook serves 30,000 sites with sub
By Steven Van ·
GitBook's tag-based cache invalidation updates docs within 300ms of a merge, as AI crawlers now generate 41% of its traffic.
GitBook hosts more than 30,000 documentation sites on a single Vercel deployment, serving 120 million page views a month for customers including n8n, Nvidia and Zoom. Before the migration, editors who merged a change would visit the live site and still see the old version.
GitBook's published content frontend runs on Next.js and uses Vercel's use cache directive to cache individual data-fetching functions rather than whole page responses. Invalidation is tag-based: a merge event, whether it comes through GitBook's app, GitHub or GitLab, revalidates only the tags tied to that content, leaving the other sites' caches untouched. GitBook now processes 40,000 of these invalidations a day, each resolved in under 300 milliseconds.
The case study also notes that AI crawlers and other automated systems now make up 41% of GitBook's page views, up 5x year-over-year in 2025, because they sweep far more pages, including cold-cache ones, than human readers do. "We need fast docs regardless of whether AI or humans are reading them," says Steven Hall, GitBook's Head of Engineering. "Our target is closer to 100% cache hits."
