Layer0 App is caching pages wrong, even when visiting the permalink that bypasses the edge

I have an ecommerce app that, a few months ago, was working fine with caching and session. It involves a session login and different UI layouts depending on sessions role.

I’ve noticed new deployments now appear to have a caching issue. When you make a fresh deployment, the first person to login will cause the page they are logging into to cache the current layout.

That is:

  1. Make a fresh deployment
  2. A non logged in user can visit the homepage (first visitor)
  3. The non logged layout is now cached on the website
  4. Anyone visiting that specific page, regardless of session, will be greeted with the non-logged in layout.
  5. If they navigate elsewhere, they will have the layout they are supposed to have

This is true for the first visitor of every page. It’s almost like the pages are stuck in a cached state depending on the first visitor, but only for SSR. Navigating routes client side seems to ignore this issue.

This is happening even when visiting a permalink, where the edge cache is skipped. In my routes file, I have explicitly disabled caching on every route that could be involved with this.

@crimsonhawk4

May you please share a reproduction?

By a reproduction do you mean a zip file where the problem also occurs or a url to see the behavior?

Yeah, a zip, if possible.