async cacheRoute(req, res, next) {
    try {
      const cacheKey = this.options.getCacheKey(req)
      req.cacheKey = cacheKey
      const result = await this.cacheGet(cacheKey)
      if( result ) {
        // If returning from cache, all we have is the raw data. Hydrate it.
        const hydratedData = await hydrateHandler(req, res, result, this.options.hydrate)
        res.send(hydratedData)
        return
      }
      next()
    } catch (err) {
      next(err)
    }
  }
/**
   * An incoming request middleware, to retrieve data from cache or pass to the actual backend.
   * @param  {ExpressRequest}  req
   * @param  {ExpressResponse} res
   * @param  {Function}        next A callback to invoke when we don't have a cached response
   */
An incoming request middleware, to retrieve data from cache or pass to the actual backend.
@param  {ExpressRequest}  req
@param  {ExpressResponse} res
@param  {Function}        next A callback to invoke when we don't have a cached response
An incoming request middleware to retrieve data from cache or pass to the actual backend . @param { ExpressRequest } req @param { ExpressResponse } res @param { Function } next A callback to invoke when we don ' t have a cached response
async cacheRoute(req, res, next) {
    try {
      const cacheKey = this.options.getCacheKey(req)
      req.cacheKey = cacheKey
      const result = await this.cacheGet(cacheKey)
      if( result ) {
        const hydratedData = await hydrateHandler(req, res, result, this.options.hydrate)
        res.send(hydratedData)
        return
      }
      next()
    } catch (err) {
      next(err)
    }
  }
async cacheRoute ( req , res , next ) { try { const cacheKey = this . options . getCacheKey ( req ) req . cacheKey = cacheKey const result = await this . cacheGet ( cacheKey ) if ( result ) { const hydratedData = await hydrateHandler ( req , res , result , this . options . hydrate ) res . send ( hydratedData ) return } next ( ) } catch ( err ) { next ( err ) } }
An incoming request middleware, to retrieve data from cache or pass to the actual backend.
An incoming request middleware to retrieve data from cache or pass to the actual backend .
// If returning from cache, all we have is the raw data. Hydrate it.