Next.js & App Router (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
Draft Mode (`draftMode().enable()`) for Headless CMS Previews.
senior LevelSystem Design
In Simple Words: Enables editors in Contentful/Sanity to preview unpublished draft content:
- CMS triggers Route Handler
/api/draft?secret=TOKEN. - Route Handler calls
draftMode().enable(), setting a secure cookie. - Subsequent page loads bypass the static Full Route Cache and fetch live draft data from the CMS API.