Revalidate after page unpublished.
Unanswered
Himalayan posted this in #help-forum
HimalayanOP
1-generate pages using generateStaticParams at build time
2-publish a page in CMS
3-visit page on site
4-using revalidation page generates at request time.
5-unpublished page in CMS
6-visit page on site
7---here I expect the page to 404 after being removed by revalidation. However the page is still present, it just hasn't got any CMS content to return.
Seems revalidation is allowing the page to generate at request time but won't remove it at request time.
Is this correct behavior? And if so do I need to do a check on the page for data being returned and if it isn't manually trigger a 404?
2-publish a page in CMS
3-visit page on site
4-using revalidation page generates at request time.
5-unpublished page in CMS
6-visit page on site
7---here I expect the page to 404 after being removed by revalidation. However the page is still present, it just hasn't got any CMS content to return.
Seems revalidation is allowing the page to generate at request time but won't remove it at request time.
Is this correct behavior? And if so do I need to do a check on the page for data being returned and if it isn't manually trigger a 404?
5 Replies
HimalayanOP
This could potentially be because of manually removing the bypass cookie. Will test later with an api route instead
HimalayanOP
Doesn't seem to be the issue. The page still generates
So how do I get a page to be removed by revalidation?
HimalayanOP
Bump
HimalayanOP
Is it expected that next doesn't remove pages on revalidate? If so I can show a sort of "this page has been removed" message