+ return cached as CachedRoute
+ }
+
+ setCachedRoute (req: express.Request, body: any, lifetime: number, contentType?: string, statusCode?: number) {
+ const cached: CachedRoute = {
+ body: body.toString(),
+ contentType,
+ statusCode: statusCode.toString()
+ }
+
+ return this.setObject(this.buildCachedRouteKey(req), cached, lifetime)
+ }
+
+ generateResetPasswordKey (userId: number) {
+ return 'reset-password-' + userId
+ }
+
+ buildViewKey (ip: string, videoUUID: string) {
+ return videoUUID + '-' + ip
+ }
+
+ buildCachedRouteKey (req: express.Request) {
+ return req.method + '-' + req.originalUrl