Closed Zae closed 2 years ago
I'm having some trouble validating if this actually works on our testing server right now, also according to brandon only checking for token is not correct, so maybe isPreview
is correct, I just need to add the preview query param to the api request as well from my frontend to get it to work?
OK, I changed to start usingisPreview
again, people just need to remember to pass the x-craft-live-preview
along.
Works correctly on our test server now :)
Just released Element API 2.8.0, which no longer caches responses for Live Preview requests.
Description
When using the
cache
parameter (which is now default, since 2.7.0), using preview in the CMS causes the API to always return the preview version.I believe this is because element-api always caches the request and does not check if the request is a preview request. In subsequent requests the cache is found and simply returned.
In 2.6.0 the preview was broken, but because the published version kept being served instead of the draft, now with the changes in 2.7.0 the cache is cleared when a draft is saved which causes the draft to be cached.
Steps to reproduce
Additional info