Showing
2 changed files
with
10 additions
and
0 deletions
@@ -5,6 +5,11 @@ const checkParams = require('../../utils/check-params'); | @@ -5,6 +5,11 @@ const checkParams = require('../../utils/check-params'); | ||
5 | const apiMaps = require('../../config/api-map'); | 5 | const apiMaps = require('../../config/api-map'); |
6 | 6 | ||
7 | module.exports = async(req, res, next) => { | 7 | module.exports = async(req, res, next) => { |
8 | + res.set({ | ||
9 | + 'Cache-Control': 'no-cache', | ||
10 | + Pragma: 'no-cache', | ||
11 | + Expires: (new Date(1900, 0, 1, 0, 0, 0, 0)).toUTCString() | ||
12 | + }); | ||
8 | const apiInfo = apiMaps[req.path]; | 13 | const apiInfo = apiMaps[req.path]; |
9 | 14 | ||
10 | if (!apiInfo) { | 15 | if (!apiInfo) { |
@@ -73,6 +73,11 @@ const getCacheKey = (urlPath, cackeKey = '') => { | @@ -73,6 +73,11 @@ const getCacheKey = (urlPath, cackeKey = '') => { | ||
73 | const render = (route) => { | 73 | const render = (route) => { |
74 | return async(req, res, next) => { | 74 | return async(req, res, next) => { |
75 | try { | 75 | try { |
76 | + res.set({ | ||
77 | + 'Cache-Control': 'no-cache', | ||
78 | + Pragma: 'no-cache', | ||
79 | + Expires: (new Date(1900, 0, 1, 0, 0, 0, 0)).toUTCString() | ||
80 | + }); | ||
76 | res.setHeader('X-YOHO-Version', pkg.version); | 81 | res.setHeader('X-YOHO-Version', pkg.version); |
77 | const isDegrade = _.get(req.app.locals.wap, 'webapp.degrade', false); | 82 | const isDegrade = _.get(req.app.locals.wap, 'webapp.degrade', false); |
78 | 83 |
-
Please register or login to post a comment