Authored by 周少峰

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

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