Next.js Discord

Discord Forum

How do you delete pages in NextJS App router?

Unanswered
Ratonero Mallorquin posted this in #help-forum
Open in Discord
Ratonero MallorquinOP
Is it possible to completely purge a url in NextJS? I have a headless CMS with a page being served. After a while, the page is deleted from the CMS. The CMS API properly returns a 404. No matter how much I call revalidate (also my revalidate time is set to 5 seconds), NextJS keeps serving the deleted page.
I can also clearly see the cached files kept in .next/cache/fetch-cache.

The only solution I've seen is set cache to no-store, but that means no caching at all.

Is page deletion not possible with App router?
I know pages router can handle it somewhat, if you delete the pages yourself manually from the file system. Do we need to do the same here?

0 Replies