feat: page cache + save/load logic + db fixes

This commit is contained in:
Nicolas Giard
2018-09-15 20:58:23 -04:00
parent 572393aa7b
commit 2c6a95f900
9 changed files with 159 additions and 66 deletions

View File

@@ -1,5 +1,6 @@
const qs = require('querystring')
const _ = require('lodash')
const crypto = require('crypto')
module.exports = {
/**
@@ -26,5 +27,11 @@ module.exports = {
}
pathObj.path = _.join(pathParts, '/')
return pathObj
},
/**
* Generate unique hash from page
*/
generateHash(opts) {
return crypto.createHash('sha1').update(`${opts.locale}|${opts.path}|${opts.privateNS}`).digest('hex')
}
}