Help with next.js 13.4

next.js 13.4 if i'm not wrong uses a revaledating thing, so my page is not in every request a fresh one, like i have a page (server component) and i got a mysql values and view them in the page, the page will not be fresh, as a specific time will gone, so how can i make a every single request will give me a fresh page? is there's a config or whatever cuz i see the docs and nothing helped me, thanks. and please mention me if you replied.
1 Reply
ABK | Muneer
ABK | Muneer16mo ago
Idk if you're still looking for answer but the answer is
const response = await fetch(
"https://api.github.com/users/iraqianDev/repos",
{
// cache: "force-cache", // Static Site Generation
//only use the one above to make multiple html page that is not changing
// cache: "no-store", // Server Side Generation
//only use the one to fetch and make component on every request
next: {
revalidate: 60 * 60, // Incremental Site Generation every hour
//only use this to make Static site that will regenerate on requested time
},
}
)
const response = await fetch(
"https://api.github.com/users/iraqianDev/repos",
{
// cache: "force-cache", // Static Site Generation
//only use the one above to make multiple html page that is not changing
// cache: "no-store", // Server Side Generation
//only use the one to fetch and make component on every request
next: {
revalidate: 60 * 60, // Incremental Site Generation every hour
//only use this to make Static site that will regenerate on requested time
},
}
)
for you you need to do is
const response = await fetch(
"https://api.github.com/users/iraqianDev/repos",
{
cache: "no-store"
}
)
const response = await fetch(
"https://api.github.com/users/iraqianDev/repos",
{
cache: "no-store"
}
)
Want results from more Discord servers?
Add your server