wenish
wenish
TTCTheo's Typesafe Cult
Created by Y7YA on 3/12/2024 in #questions
NextJS Server Cache?
good question. the data did not change. the template did. symptoms are true or better said. they are objects. we have a lot of db entries while its building. (if it would be false. it would render the not found page which it dosnt) so maybe thats the problem.... but obviously if i update the page template (react component) and build and deploy the new version i want the users to see the new version and not an old page 😄
8 replies
TTCTheo's Typesafe Cult
Created by Y7YA on 3/12/2024 in #questions
NextJS Server Cache?
@Mike
export async function getStaticProps(context: { params: { name: string } }) {
const name = context.params.name
const data = await db.symptom.findUnique()

if (!symptom) {
return {
notFound: true
}
}

return {
props: {
preFetchedData: data
},
revalidate: 60
}
}
export async function getStaticProps(context: { params: { name: string } }) {
const name = context.params.name
const data = await db.symptom.findUnique()

if (!symptom) {
return {
notFound: true
}
}

return {
props: {
preFetchedData: data
},
revalidate: 60
}
}
do you know how exactly this revalidate works? if read in the docs this would cache the page for 60 seconds and then on the next request it would render it new. but it seems this return alone isnt enough. can you put me into the right direction what else the server needs? Im hosting the site on vercel default config
8 replies