+ const redisKey = Redis.Instance.buildCachedRouteKey(req)
+
+ try {
+ await lock.acquire(redisKey, async (done) => {
+ const cached = await Redis.Instance.getCachedRoute(req)
+
+ // Not cached
+ if (!cached) {
+ logger.debug('No cached results for route %s.', req.originalUrl)
+
+ const sendSave = res.send.bind(res)
+
+ res.send = (body) => {
+ if (res.statusCode >= 200 && res.statusCode < 400) {
+ const contentType = res.get('content-type')
+ const lifetime = parseDuration(lifetimeArg)