Describe the issue you're facing
Responses from the Storyblok API are cached when retrieving published content, even when apiOptions contains a cache type of none.
Reproduction
https://stackblitz.com/edit/withastro-astro-971qsd?file=.env
Steps to reproduce
Using Astro in SSR mode via output: 'server' and the Node adapter in mode: standalone, responses from the Storyblok API are cached when retrieving published content, even when apiOptions contains a cache type of none.
For example, the following call via useStoryblok() will return the cached response, not reflecting any updated (published) content:
const story = await useStoryblok(`cdn/stories/home`, {
version: "published",
}
)
I've also tested with the settings as in playground-ssr in the repo, which has the following settings:
apiOptions: {
cache: {
clear: "auto",
type: "memory",
},
}
This produced the same result.
However, if the exact same useStoryblok() call is set to retrieve drafts, everything updates when the page is refreshed, including draft and published content:
const story = await useStoryblok(`cdn/stories/home`, {
version: "draft",
}
)
There appears to be a closed and merged PR from three weeks ago in the storyblok-js-client repo but for whatever reason, this doesn't seem to have fixed the issue in the Storyblok Astro SDK.
Tested with the latest release (v5.0.2) of @storyblok/astro, which appears to contain the latest release of storyblok/storyblok-js-client from looking at the version installed in node_modules.
System Info
System:
OS: macOS 15.0.1
CPU: (10) arm64 Apple M1 Pro
Memory: 66.47 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
bun: 1.0.22 - ~/.bun/bin/bun
Browsers:
Brave Browser: 130.1.71.114
Chrome: 129.0.6668.103
Safari: 18.0.1
Safari Technology Preview: 18.0
Used Package Manager
npm
Error logs (Optional)
No response
Validations
Describe the issue you're facing
Responses from the Storyblok API are cached when retrieving published content, even when
apiOptionscontains a cache type ofnone.Reproduction
https://stackblitz.com/edit/withastro-astro-971qsd?file=.env
Steps to reproduce
Using Astro in SSR mode via
output: 'server'and theNodeadapter inmode: standalone, responses from the Storyblok API are cached when retrieving published content, even whenapiOptionscontains a cache type ofnone.For example, the following call via
useStoryblok()will return the cached response, not reflecting any updated (published) content:I've also tested with the settings as in
playground-ssrin the repo, which has the following settings:This produced the same result.
However, if the exact same
useStoryblok()call is set to retrieve drafts, everything updates when the page is refreshed, including draft and published content:There appears to be a closed and merged PR from three weeks ago in the storyblok-js-client repo but for whatever reason, this doesn't seem to have fixed the issue in the Storyblok Astro SDK.
Tested with the latest release (
v5.0.2) of@storyblok/astro, which appears to contain the latest release ofstoryblok/storyblok-js-clientfrom looking at the version installed innode_modules.System Info
System: OS: macOS 15.0.1 CPU: (10) arm64 Apple M1 Pro Memory: 66.47 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm bun: 1.0.22 - ~/.bun/bin/bun Browsers: Brave Browser: 130.1.71.114 Chrome: 129.0.6668.103 Safari: 18.0.1 Safari Technology Preview: 18.0Used Package Manager
npm
Error logs (Optional)
No response
Validations