nostore doesnt really work?
Unanswered
American Crocodile posted this in #help-forum
American CrocodileOP
async function getMapsData(): Promise<AppleMapsType> {
noStore();
const data = await AppleMaps.findOne().sort({ created_at: -1 });
console.log(data)
return data as AppleMapsType;
}
// TODO: USE CLIENT FOR NO CACHE OR USE REVALIDATE=0 N FORCE DYNAMIC
// TODO: SWITCH TO SQL IG? TRY AT LEAST
export default async function BentoProfile() {
noStore();
await dbConnect();
// const [healthData, mapsData]: [AppleHealthType, AppleMapsType] = await Promise.all([getHealthData(), getMapsData()]);
const healthData = await getHealthData();
const mapsData = await getMapsData();So i have this code that tries to get the latest data from the database, and with nostore in a
Component. However the data fetched is the same with the previous data even though there is another latest data that has been inserted / created.2 Replies
American CrocodileOP
Is it because of the cached data memoization at this one?
Im not too sure however
AppleMaps.findOne().sort({ created_at: -1 });Im not too sure however
American CrocodileOP
( and my site is pretty slow )