-
Notifications
You must be signed in to change notification settings - Fork 15
Description
This is kind of an edge case but if you publish a story, unpublish it then publish it again the changes are not reflected in Magento until you manually clear the cache.
Steps to replicate:
- Publish a new page in SB.
- Go to the Magento page URL, page looks ok as expected.
- Unpublish the page in SB.
- Go to the Magento page URL, see a 404 page as expected.
- Publish the same page in SB again.
- Go to the Magento page URL.
Expected result:
See the SB page in Magento like on step 2.
Actual result:
A 404 page is shown.
The reason for this is that the module only clears cache keys that look like "storyblok_{ID}" or "storyblok_slug_${SLUG}" so only pages using these stories are cleared. The moment the story is unpublished these cache keys are removed from the page so when the story is published the 2nd time the cache for these pages is never cleared.
I'm not sure what the best way to fix this is other than clearing the whole Magento cache when you publish a new story but I want to avoid that as much as possible. This is not a common use case and the workaround is simple enough so it's not high in the list of priorities.