mirror of
https://github.com/30hours/blah2.git
synced 2024-11-08 12:25:42 +00:00
Fix caching issue on API
This commit is contained in:
parent
0e1cef7874
commit
161ec95b05
2 changed files with 7 additions and 0 deletions
|
@ -13,6 +13,9 @@ const app = express();
|
||||||
// header on all requests
|
// header on all requests
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
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();
|
next();
|
||||||
});
|
});
|
||||||
app.get('/', (req, res) => {
|
app.get('/', (req, res) => {
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta charset="UTF-8">
|
<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>
|
<title>blah2</title>
|
||||||
|
|
||||||
<!-- load lib js -->
|
<!-- load lib js -->
|
||||||
|
|
Loading…
Reference in a new issue