Page stays cached forever until next deployment
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
I've tried next revalidate with all my endpoints however i'm not seeing any changes as they stay cached still
3 Replies
Chinese Egret
Do you use time based revalidation or on-demand? Also NEXT.js caches pages on the client for a litte time
Transvaal lionOP
here is one of my request im using 🥹: export async function getDiscoverMovieAction(page: number | string) {
try {
const params = new URLSearchParams({
page: parsePaginationPageNumber(page),
api_key: process.env.THE_MOVIE_DATABASE_API_KEY,
language: "en-US",
});
const res = await fetch(
{ next: { revalidate: daysToSeconds(1) } }
);
const data = await res.json();
return data;
} catch (error) {
console.log(error);
}
}
try {
const params = new URLSearchParams({
page: parsePaginationPageNumber(page),
api_key: process.env.THE_MOVIE_DATABASE_API_KEY,
language: "en-US",
});
const res = await fetch(
${
process.env.NEXT_PUBLIC_THE_MOVIE_DATABASE_API_URL
}/discover/movie?${params.toString()},{ next: { revalidate: daysToSeconds(1) } }
);
const data = await res.json();
return data;
} catch (error) {
console.log(error);
}
}
im even more lost when it caches the ones that comes directly from the database:
export async function getUserWatchListAction(userId: string) {
if (!userId) return [];
const userWatchList = await db
.select()
.from(watchlist)
.where(eq(watchlist.userId, userId));
return userWatchList;
}
export async function getUserWatchListAction(userId: string) {
if (!userId) return [];
const userWatchList = await db
.select()
.from(watchlist)
.where(eq(watchlist.userId, userId));
return userWatchList;
}