Draft/Published content not updated

Hi,
Our developer team it’s facing problems with some stories content. Sometimes storyblok API don’t retrieve updated data using preview token.

This behavior is weird because in different browsers or REST clients we get different responses.

To reproduce this we follow this steps:

  1. Creates a new component.
  2. Creates a new content page.
  3. Adds content and save.
  4. Gets data using browser or REST clients, using preview token.
  5. Change content on previously created content page.
  6. Gets data again.

Thanks in the advance!

Hello Patricio,

are you requesting the published content? If yes you will need to pay attention to the cv parameter which is required when working with it. The value of the cv (cache version) parameter needs to be changed so that the new content can be fetched from the server instead of getting the old content from the CDN.
This is a typical request for getting the published content:
https://api.storyblok.com/v1/cdn/stories/home?version=published&token=5EgKInxYa31dIBnLS3UrSQtt&cv=1595529854

In the case that you’re working with the draft version in your development environment you can omit the value because it doesn’t use the CDN for caching.
This is a typical request for getting the draft content:
https://api.storyblok.com/v1/cdn/stories/home?version=draft&token=5EgKInxYa31dIBnLS3UrSQtt
You can attach the cv parameter like here https://api.storyblok.com/v1/cdn/stories/home?version=draft&token=5EgKInxYa31dIBnLS3UrSQtt&cv=1595529854 but it is without any effect because the draft content comes always directly from our server but doesn’t offer the same performance like the cached responses from the CDN.

With best regards
Hannes