Versions (in vue -- nuxt.js)

Has anyone tried to pull a specific version out of the prismic.io API? While it works well in the API explorer, i do not seem to find a way to do this in the nuxt.js... all i keep getting is the master version. What's the point of having a "ref" then?

Hi @eugenio,

The ref ensures that you have the most recent version of your content.

Our API generally keeps up to five of the most recent versions, so you can access them by their refs, but this is not a feature and we do not recommend that you query old refs.

The point of the ref is to enable caching and high-performance API queries. When you query the API, you make two API calls. The first call fetches your master ref, which is an ID for the most recent version of your content. The second API call fetches your content using that ref. If the content in the cache has an older ref, then the cache is invalidated and you get the newer content associated with the latest ref. But if the ref matches, you get the cached content, which improves performance.

I hope that makes sense! Let me know if you have any questions.

Sam

Edit: The ref also enables you to query previews of content in releases and drafts.

Edit: The ref also enables you to query previews of content in releases and drafts.

Yes, that's what i thought, but we are not able to get a specific version, we are always getting the master version

Hi Eugenio,

With the @prismic/nuxt plugin it's not possible to query by a release ref. This has been discussed here:

and is a feature request on that plugins github here:

Thanks.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.