code: def process_request(self, req, resp):
          
  
          key = req.env['REMOTE_PORT'] + req.env['REMOTE_ADDR']
          val = self.cache.get(key, 0)
  
          if val == self.count:
              abort(exceptions.TooManyRequests(headers=self._error_headers))
          else:
              self.cache[key] = val + 1
docs: Process the request before routing it.