I’m testing/working on a NuxtJS SSR website/webapp where we create articles and article-comments though the CM API and publish with the CD API. However, when an article has been updated (edited or new comment) we need the cache to expire and trigger a fresh copy through CD. We can’t seem to find it in the docs … Is it possible? Or what would be the best way to deal with renewing the object cache?
You are asking that because it’s not working automatically? Cache should expire automatically on every change. If it’s not, can you please provide an example so that we can reproduce and fix?
Thanks for your quick response, @mat_jack1 Good to know that it should expire on each change by default. To us it seemed that it wasn’t always the case. (Often yes, but sometimes not). But knowing this, we will dig and debug some more.
What would be the best field to check to see if it is a fresh copy, the updatedAt field or should we check for certain headers in the CD response?
I’m having the same issue when using the draft endpoint.
When I send a graphQL query after I update a record, it returns stale data. If I modify the text of the graphQL query, like removing a property, and send it, it returns the new, updated data.
This is a blocking issue for us, as our preview endpoints show stale data unless I update the client code to send a slightly modified query, which is untenable.