Authored by 陈峰

cache ios and android

... ... @@ -85,12 +85,13 @@ const handlerError = (err = {}, req, res, next) => {
const getCacheKey = (req, cacheKey = '') => {
const isYohoProtocol = _.get(req.app.locals.wap, `webapp.${config.appName}-yoho-protocol`, false);
const urlObj = url.parse(req.url);
const isIos = req.yoho.isiOS;
const yohoProtocol = (req.get('User-Agent').indexOf('yoho-protocol') >= 0 && isYohoProtocol) ? 'yoho-protocol' : '';
return md5(cacheKey
.replace('$url', urlObj.pathname)
.replace('$params', urlObj.query || '')
.replace('$yoho-protocol', yohoProtocol));
.replace('$yoho-protocol', yohoProtocol) + (isIos ? 'ios' : 'android'));
};
const render = (route) => {
... ...