def add(self, req):
        """
        Add a request to the cache
        """
        if not req.reqid:
            req.reqid = self.get_memid()
        if req.reqid[0] == 'm':
            self.inmem_reqs.add(req)
        if req.is_unmangled_version:
            self.unmangled_ids.add(req.reqid)
        if req.unmangled:
            self.unmangled_ids.add(req.unmangled.reqid)
        self._cached_reqs[req.reqid] = req
        self._update_last_used(req.reqid)
        self.req_times[req.reqid] = req.sort_time
        if req.reqid not in self.all_ids:
            self.ordered_ids.insert(req.reqid)
        self.all_ids.add(req.reqid)
        if len(self._cached_reqs) > self._cache_size and self._cache_size != -1:
            self._evict_single()
dataset/ETHPy150Open roglew/pappy-proxy/pappyproxy/requestcache.py/RequestCache.add/original