You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
As noted in xataio/mdx-docs#206 the fetchOptions SDK parameter passes additional options to Next.js to configure the caching behavior.
Trying to verify with the Next.js Starter app, I changed the getAll call to .getMany({ pagination: { size: 10 }, fetchOptions: { next: { revalidate: '3600' } } }).
However, upon editing a record in the Xata table and refreshing the page, the app shows the latest record value instead of the previously cached result.
Repro log:
npx degit xataio/examples/apps/getting-started-nextjs xata-nextjs
cd xata-nextjs
npm install
xata init
curl https://raw.githubusercontent.com/xataio/examples/main/seed/blog-posts.csv --create-dirs -o seed/blog-posts.csv
xata import csv seed/blog-posts.csv --table Posts --create
xata pull main
edit /src/app/page.tsx to add the fetchOptions parameter
npm run dev
edit Posts table "title" column of one of the 10 rendered records.
Refresh the page on the browser.
I have tried this with both next@13.4.19 and next@14.0.4.
This is in line with relevant user report on Discord.
For the record, per internal discussion I've also tried using a standard fetch with the same parameters, which also had the same not-caching behavior under getServerSideProps.
The purpose of this issue is to determine how / what is required for the TS SDK to enable/work with Next.js caching before we document the fetchOptions parameter.
The text was updated successfully, but these errors were encountered:
Describe the bug
As noted in xataio/mdx-docs#206 the
fetchOptions
SDK parameter passes additional options to Next.js to configure the caching behavior.Trying to verify with the Next.js Starter app, I changed the getAll call to
.getMany({ pagination: { size: 10 }, fetchOptions: { next: { revalidate: '3600' } } })
.However, upon editing a record in the Xata table and refreshing the page, the app shows the latest record value instead of the previously cached result.
Repro log:
I have tried this with both
next@13.4.19
andnext@14.0.4
.This is in line with relevant user report on Discord.
For the record, per internal discussion I've also tried using a standard fetch with the same parameters, which also had the same not-caching behavior under getServerSideProps.
The purpose of this issue is to determine how / what is required for the TS SDK to enable/work with Next.js caching before we document the fetchOptions parameter.
The text was updated successfully, but these errors were encountered: