Raj
Raj
PPrisma
Created by sylvester stallone on 3/28/2024 in #help-and-questions
is there still no option to manually invalidate the cache?
Been waiting on on-demand invalidation since Accelerate was first announced.
11 replies
PPrisma
Created by Raj on 7/18/2024 in #help-and-questions
Accelerate SWR option not re-fetching/revalidating cache
Sorry, I somehow missed this @Nurul (Prisma)! Using a Postgres DB (via Supabase)
8 replies
PPrisma
Created by Raj on 7/18/2024 in #help-and-questions
Accelerate SWR option not re-fetching/revalidating cache
await prisma.userProfile.findUniqueOrThrow({
where: {
userId: userID,
},
select: {
...PLATFORM_USER_FIELDS,
},
cacheStrategy: {
ttl: 30,
swr: 60,
}
});
await prisma.userProfile.findUniqueOrThrow({
where: {
userId: userID,
},
select: {
...PLATFORM_USER_FIELDS,
},
cacheStrategy: {
ttl: 30,
swr: 60,
}
});
Like JW887 on GitHub, it doesn't seem like the request to the database is being made/processed during the SWR period. Between the 30-90 second interval post-query (when the SWR period should be hit), all queries keep returning the stale data and the cache never gets updated. The only time the updated data is received is after the full 90 seconds when the cache misses and the DB is queried directly (which would trigger another 90 seconds of stale cached data)
8 replies
PPrisma
Created by Raj on 7/18/2024 in #help-and-questions
Accelerate SWR option not re-fetching/revalidating cache
cc @Nurul (Prisma) (apologies for the ping, but you were the one who responded to the above GH discussion)
8 replies
PPrisma
Created by Raj on 7/18/2024 in #help-and-questions
Accelerate SWR option not re-fetching/revalidating cache
https://github.com/prisma/prisma/discussions/23787#discussioncomment-9277949 This seems to outline exactly what I'm experiencing...
8 replies