Next.js Discord

Discord Forum

draftMode with cacheComponents

Unanswered
Giant wood wasp posted this in #help-forum
Open in Discord
Giant wood waspOP
Honestly, what is the 'right way' to work with draft mode when you're using cacheComponents?
I want my page to be fully cached for my 99.99999% of users but I want to use draftMode for my editors. How am I meanto to do this with recreating my whole application in a draftMode only route folder?

3 Replies

Sun bear
have a separate route /draft/[[...pages]]
this way pages on /[[...pages]] are fully cached and anyone on /draft route sees the dynamic content and is redirected if he has no access to draft
Giant wood waspOP
This means recreating all my routes there though doesn't it? This is what I wanted to avoid