'Delete `url` from cache. Also deletes all urls from response history'

def del_cached_url(self, url):

    try:
        if (url in self.responses):
            (response, _) = self.responses[url]
            del self.responses[url]
        else:
            (response, _) = self.responses[self.url_map[url]]
            del self.url_map[url]
        for r in response.history:
            del self.url_map[r.url]
    except KeyError:
        pass
