def _resolve_cache_filepath(key: str, extension: str = "json") -> Path:
    """
    Determine a cache key's corresponding cache file path.

    This uses the configured `settings.cache_folder` and calculates the 160
    bit SHA-1 hash digest (40 hexadecimal characters) of `key` to determine a
    succinct but unique cache filename.

    Parameters
    ----------
    key
        The key for which to generate a cache file path, for example, a URL.
    extension
        The desired cache file's extension.

    Returns
    -------
    cache_filepath
        Cache file path corresponding to `key`.
    """
    digest = sha1(key.encode("utf-8")).hexdigest()  # noqa: S324
    return Path(settings.cache_folder) / f"{digest}.{extension}"

    Determine a cache key's corresponding cache file path.

    This uses the configured `settings.cache_folder` and calculates the 160
    bit SHA-1 hash digest (40 hexadecimal characters) of `key` to determine a
    succinct but unique cache filename.

    Parameters
    ----------
    key
        The key for which to generate a cache file path, for example, a URL.
    extension
        The desired cache file's extension.

    Returns
    -------
    cache_filepath
        Cache file path corresponding to `key`.
    
osmnx/_http.py