BuilderIO / builder

Visual Development for React, Vue, Svelte, Qwik, and more
https://builder.io
MIT License
7.36k stars 915 forks source link

SDK NextJs revalidation issue #3348

Closed pepijn-vanvlaanderen closed 1 week ago

pepijn-vanvlaanderen commented 3 months ago

Vercel started charging data cache reads and writes. This pointed us into the direction of the Builder SDK where data is fetched with options next: { revalidate: 1 }. Meaning you do write cache, but it will be deleted right after. Resulting in unwanted charges from Vercel if you have high traffic.

Expected behaviour here would be to use either { cache: 'no-store' }, but better would be to utilize the Next data cache instead of using a cache on the builder API. You can for example use next: { tags: ['builder.io'] } and with revalidateTag('builder.io') remove any data cache in NextJs.

Anyhow it would be benefitial to be able to pass the next options, so one can decide for themselves.

Related issue on the Builder forum: https://forum.builder.io/t/large-data-write-cache-issues-with-builder-io-and-vercel/5725 But the solution there is not really viable, since the issue is in the SDK itself.

jaydubb12 commented 3 months ago

@pepijn-vanvlaanderen great suggestion...did you also submit as a feature request? FYI, I have found that path useful as well...and have found the response / progress on Github to be a bit slower....hence the 46 open...and mostly stale PRs on this repo

samijaber commented 1 week ago

Duplicate of https://github.com/BuilderIO/builder/issues/3445

Fixed and published in https://github.com/BuilderIO/builder/pull/3489