-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Published responses cached regardless of caching settings #952
Comments
Any news here @dipankarmaikap ? I am using the new content layer feature and getting the same problem. import {storyblokLoader} from '@storyblok/astro';
import {defineCollection} from 'astro:content';
import StoryblokApi from '../utils/StoryblokApi';
const storyblokCollection = defineCollection({
loader: storyblokLoader({
accessToken: import.meta.env.STORYBLOK_TOKEN,
version: StoryblokApi.getVersion(),
apiOptions: {
cache: {
type: 'none',
},
},
}),
});
export const collections = {
storyblok: storyblokCollection,
}; |
Replacing the same asset with a new version (for example when using the storyblok web image editor) the cache does not get refreshed too. |
Hi @J05HI, Thank you for reporting this! Please note that the Storyblok Astro Content Layer API is still in its early experimental phase. We wouldn’t recommend using it in production just yet, but we truly appreciate you trying it out and providing feedback to help us improve. |
Hi @nathobson, the behavior you are facing reflects the current cache behavior in Storyblok, it's not that something isn't working, it's actually how it's supposed to work. The I tried to cover everything in this FAQ page: https://www.storyblok.com/faq/how-stories-are-cached-content-delivery-api This should give you many possibilities to implement your own strategies. As stated in the FAQ, you can always bypass the cache helpers in the client, if you understand the impact on the rate limits. I hope this helps. cc @J05HI |
Describe the issue you're facing
Responses from the Storyblok API are cached when retrieving published content, even when
apiOptions
contains 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 theNode
adapter inmode: standalone
, responses from the Storyblok API are cached when retrieving published content, even whenapiOptions
contains 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-ssr
in 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-client
from looking at the version installed innode_modules
.System Info
Used Package Manager
npm
Error logs (Optional)
No response
Validations
The text was updated successfully, but these errors were encountered: