I'm attempting to make my MEAN stack web app work with Edge. The app works perfectly in Safari and Chrome. The issue is every time I log in (utilizing passport.js) as one user, the app shows data from the user previously logged in. If I refresh the page, the previous user's data is still there. After an extended period of time, the new user's data will appear.
Maybe a caching issue, as functionality becomes perfect once I open Dev Tools and click the "Always refresh from server" button on the toolbar. Too bad I can't ask every Edge customer to do this in order to use the app. How do I set this feature for the user, or stop this crazy caching, so functionality works in Edge?
I have tried to prevent all caching with express using this code:
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
res.header('Expires', '-1');
res.header('Pragma', 'no-cache');
However this method hasn't been working, and I wonder how it will affect performance on other browsers? I tried placing this on the user controller whenever a user object was retrieved or created, but the caching issue was still there. Please help!