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.
- Make a fresh deployment
- A non logged in user can visit the homepage (first visitor)
- The non logged layout is now cached on the website
- Anyone visiting that specific page, regardless of session, will be greeted with the non-logged in layout.
- 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.