@staticmethod
def generate_cache_key(req, method: str=None) ->str:
    """ Generate the cache key from the request using the path and the method """
    path = req.path
    if path.endswith('/'):
        path = path[:-1]
    if not method:
        method = req.method
    return f'{path}:{method.upper()}'
