cache.js 1.67 KB

'use strict';

const SECOND = 1;
const MINUTE = 60 * SECOND;
const DAY = 86400 * SECOND;

const cachePage = {

    // 频道页
    '/': 30 * SECOND,
    '/woman/': 30 * SECOND,
    '/girls/': 30 * SECOND,
    '/kids/': 30 * SECOND,
    '/lifestyle/': 30 * SECOND,

    // 商品详情页
    '/product/^\\/([\\d]+)(.*)/': 5 * MINUTE,

    // 逛
    '/guang/': 10 * MINUTE,
    '/guang/info/detailData': 10 * MINUTE,
    '/guang/^\\/([\\d]+)(.*)/': 10 * MINUTE,
    '/guang/detail/:id': 10 * MINUTE,
    '/guang/Index/editor': 1 * MINUTE,
    '/guang/tags/index': 1 * MINUTE,

    // 领券中心
    '/coupon/': 5 * MINUTE,

    // 商品列表
    '/product/list/index': 10 * MINUTE,
    '/product/index/index': 10 * MINUTE,

    // 秒杀列表
    '/product/seckill': 30 * SECOND,

    // 秒杀详情

    // sale
    '/product/\\/(.*)-sale/': 5 * MINUTE,
    '/product/sale': 5 * MINUTE,
    '/product/sale/vip': 5 * MINUTE,
    '/product/sale/breakingYards': 5 * MINUTE,
    '/product/sale/newSale': 5 * MINUTE,
    '/product/sale/discount/detail': 5 * MINUTE,
    '/product/sale/special/detail': 5 * MINUTE,

    '/product/outlet': 30 * SECOND,

    '/product/index/brand': 5 * MINUTE,
    '/product/index/about': 10 * MINUTE,

    '/product/shoplist': 5 * MINUTE,
    '/product/shop': 5 * MINUTE, // 店铺首页

    '/product/list/new': 30 * SECOND,

    // 品牌一览
    '/brands': 5 * MINUTE,
    '/\\/(boys|girls|kids|lifestyle)-brands(\\/)?$/': 5 * MINUTE,
    '/brands/plusstar': 5 * MINUTE,

    '/^\\/special\\/(\\d+)_(.*)\\.html$/': 5 * MINUTE,
    '/product/search/keyword/:id': 7 * DAY,

    // 帮助
    '/help/': 7 * DAY,
    '/help/detail': 7 * DAY,
};

module.exports = cachePage;