Fix caching issue on API

This commit is contained in:
30hours 2023-10-27 16:23:42 +10:30
parent 0e1cef7874
commit 161ec95b05
2 changed files with 7 additions and 0 deletions

View file

@ -13,6 +13,9 @@ const app = express();
// header on all requests
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
res.header('Expires', '-1');
res.header('Pragma', 'no-cache');
next();
});
app.get('/', (req, res) => {

View file

@ -7,6 +7,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>blah2</title>
<!-- load lib js -->