Hi, I'm not using the module so haven't been able to confirm, but I did a quick look at the code and it seems to me it might be missing a cache context? IIUC currently it embeds per-user data and adds a user cache tag, which ensures the cache gets cleared if the user entity's updated. But it doesn't indicate to the cache that different users have different data.
You could add a user cache context. I think by default that would make the page uncacheable, see https://www.drupal.org/docs/drupal-apis/cache-api/cache-contexts#s-uncac... → , but you could add a lazy builder.
I was thinking an alternative to having a user cache context that would have less impact on the page's cacheability might be to simply detect if a user is logged-in, and pass that as a JS setting. If the user's logged in the JS can make an AJAX call to a custom route to grab any necessary data. This could play nicely with Varnish etc. in a way I don't think lazy builders can.
Thanks, hope I'm not time-wasting, this caching stuff can be tough (:
Active
1.0
Code