Authored by 周少峰

Merge branch 'release/hbs' of git.yoho.cn:fe/yohobuy-node into release/hbs

@@ -16,8 +16,9 @@ const cachePage = { @@ -16,8 +16,9 @@ const cachePage = {
16 '/product/\\/pro_([\\d]+)_([\\d]+)\\/(.*)/': 30 * MINUTE, 16 '/product/\\/pro_([\\d]+)_([\\d]+)\\/(.*)/': 30 * MINUTE,
17 17
18 // 逛 18 // 逛
19 - '/guang': 1 * MINUTE, 19 + '/guang/': 1 * MINUTE,
20 '/guang/info/index': 10 * MINUTE, 20 '/guang/info/index': 10 * MINUTE,
  21 + '/guang/detail/:id': 10 * MINUTE,
21 '/guang/index/editor': 1 * MINUTE, 22 '/guang/index/editor': 1 * MINUTE,
22 '/guang/tags/index': 1 * MINUTE, 23 '/guang/tags/index': 1 * MINUTE,
23 24
@@ -49,7 +50,7 @@ const cachePage = { @@ -49,7 +50,7 @@ const cachePage = {
49 '/product/list/new': 30 * SECOND, 50 '/product/list/new': 30 * SECOND,
50 51
51 // 品牌一览 52 // 品牌一览
52 - '/brands': 5 * MINUTE, 53 + '/brands/': 5 * MINUTE,
53 '/brands/plusstar': 5 * MINUTE, 54 '/brands/plusstar': 5 * MINUTE,
54 55
55 '/special/(\\d+)_(.*)\\.html': 5 * MINUTE 56 '/special/(\\d+)_(.*)\\.html': 5 * MINUTE
@@ -21,6 +21,11 @@ module.exports = () => { @@ -21,6 +21,11 @@ module.exports = () => {
21 function onRender() { 21 function onRender() {
22 let route = req.route ? req.route.path : ''; 22 let route = req.route ? req.route.path : '';
23 let appPath = req.app.mountpath; 23 let appPath = req.app.mountpath;
  24 +
  25 + if (_.isArray(route) && route.length > 0) {
  26 + route = route[0];
  27 + }
  28 +
24 let key = urlJoin(appPath, route.toString()); // route may be a regexp 29 let key = urlJoin(appPath, route.toString()); // route may be a regexp
25 30
26 req.app.set('etag', false); 31 req.app.set('etag', false);