I have an app using express and Node.js. In this app user login using credential and then generate JWT token to authenticate further HTTP request. I am trying to remove browser cache so when user log out there should be no browser cache web page when the user hit back/forward button. I did some research and tried some solutions but no success. One of them is -
app.use(function (req, res, next) {
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
res.header('Expires', '-1');
res.header('Pragma', 'no-cache');
next()
});
Please guide. Thanks