code: function send(stream) {
        res.setHeader('content-type', mimetype);
  
        if (config.setCacheControl && !isNaN(config.maxAge)) {
          res.setHeader('Cache-Control', `public, max-age=${Math.floor(config.maxAge / 1000)}`)
        }
  
        if (config.beforeSend === 'function') {
          config.beforeSend(res, stream);
        }
        
        stream2buffer(stream, (err, buffer) => {
          if (err) {
            // faild to convert to buffer so lets just stream it.
            res.status(500).send('Internal Server Error');
            return;
          }
          
          const eTag = etag(buffer);
          const headers = req.headers;
          
          if (headers['if-none-match'] && headers['if-none-match'].replace('"', '') === eTag) {
            res.status(304);
            res.setHeader('ETag', eTag);
            res.setHeader('Content-Length', 0);
            res.end();
            return;
          }
          
          res.setHeader('ETag', eTag);
  
          res.send(buffer);
        });
      }
docs: Helper functions