Describe the bug
I am getting some data from my DB in getInitialProps.
When I changed my DB data, getInitialProps didn't catch the changed data.
To Reproduce
MyPage.getInitialProps = async (props) => {
try{
const { data } = await axios.get('MY_API_URL').catch((e)=>{ throw e });
if(data.isPublished) return { data };
else throw data;
}catch(e){
return { ...e }
}
}
This issue occurs in production.
This code is working even I changed isPublished to false.
I mean,
At the first, I set up the isPublished to false.
I entered the Web, I can see Error Page.
and then, I changed the isPublished to true.
I entered the Web, I can see MyPage.
and, I changed again to false the isPublished.
I entered the Web, I can still see MyPage.
Expected behavior
I want to remove the cached data in getInitialProps
What I am missing?