Home App Docs Blog Github

NextJS-shopify publish cache issue

Hi

I’m trying to move the existing website to the NextJS-shopify + Builder.

For the POC I’ve recreated one page and it looks perfect in the editor and when clicking “view current draft”. But if I publish and click “view live page” I would see one of the old intermediate versions of the page even after waiting 12 hours since publishing.

Here are the details.

  1. I’ve forked the repo https://github.com/BuilderIO/nextjs-shopify and deployed it to the “Netlify” following the guide (example demo page https://jolly-wozniak-731104.netlify.app/faq)

  2. After that I’ve implemented a new page using custom blocks (HTML+CSS) using Builder editor, see screenshot https://monosnap.com/file/Njs6tSbIY8CGaHiHRN36OoXQn3JBpS

  3. If I click “view current draft” I would see the page as good as an in the editor with all the blocks and styles, see the link https://jolly-wozniak-731104.netlify.app/landing-pure-styles?builder.cachebust=true&builder.preview=page&builder.noCache=true&__builder_editing__=true&builder.overrides.page=1d2a26501b364df09551c407986d4114&builder.overrides.1d2a26501b364df09551c407986d4114=1d2a26501b364df09551c407986d4114&builder.overrides.page:/landing-pure-styles=1d2a26501b364df09551c407986d4114 and screenshot https://monosnap.com/file/Zp3mCazjDJLnMsqBSBAwEfxN8O1ikJ

  4. But if I click “view live page” I would see one of the first old versions of the page, see link https://jolly-wozniak-731104.netlify.app/landing-pure-styles and screenshot https://monosnap.com/file/AtJ1Mo0FFYPW9xTUG6kn9CEjYPB86T

  5. I’d like to note, that page was published more than 12 hours ago, here is the screenshot of the history https://monosnap.com/file/3ovXwgAsfBedQrow7LprbwkhCGzbwL

  6. I’ve tried to implement the same page again, but got the same issue:

    • looks good in editor https://monosnap.com/file/vbMhcrn2KtIBoh5sxWDrIhHxMWT5JV
    • looks good when clicking “view current draft” link https://jolly-wozniak-731104.netlify.app/landing-poc-full?builder.cachebust=true&builder.preview=page&builder.noCache=true&__builder_editing__=true&builder.overrides.page=f414c10f2c074e468017e227e3967382&builder.overrides.f414c10f2c074e468017e227e3967382=f414c10f2c074e468017e227e3967382&builder.overrides.page:/landing-poc-full=f414c10f2c074e468017e227e3967382 and screenshot https://monosnap.com/file/jsPEImNneawCckcQj8ZwcJ0sra3cYD
    • when clicking “view live page” shows page is not found, link https://jolly-wozniak-731104.netlify.app/landing-poc-full and screenshot https://monosnap.com/file/WpZySyZIaOv0GCS6aX1XIQdBh52BOA
    • after some time it showed me the correct published version by the same link without any action from my side except page reloading
    • and after reloading it showed me one of the old versions, screenshot https://monosnap.com/file/dm7aDIr5k75AtHWsXLzmdITHZbalDs

The most interesting moment, that sometimes when clicking “view live page” I see one old version, sometimes another one, so the result is quite random. But usually, these are really old versions that were at the beginning of editing. Sometimes it looks like the more times I click “publish” the older version I see after that.

It looks like some kind of cache issue. Is there any way on how to fix it, or maybe some ideas what could be tried to bypass it?

Regards,
Maksym

I did one more experiment.

I’ve recreated exactly the same page by copy/pasting custom block codes into a newly created page. And published this new page only 1 time landing-poc-full2 - Headless Demo. As the cache issue causes showing random old versions and there is only 1 version it doesn’t have another choice except of showing correct published verison, checkmate :grin:

The only issue I’ve noticed so far:

  • first, it returned the page 404
  • after some time it returned the correct page
  • atter some time it returned page 404 again
  • after some time it returned correct page again, and it does for now, so I’m holding my breath

I hope this might help to find the root cause of the issue.

Hey @maxceem thanks so much for reaching out! Our technical team investigated and has confirmed that the content is heavily cached on Netlify’s side. I would recommend contacting Netlify’s support as it’s easily reproducible.

1 Like

Having a very similar issue where my current draft looks good but my live (which should be the same version) is having very weird rendering issues and doesn’t look the same/looks older. Wondering if this was resolved on anyone’s end? My custom components are also NextJS based