def METHOD_NAME(
    url,
    expected_status_code=200,
    expected_location=None,
    is_behind_cdn=True,
    method="get",
    **request_kwargs,
):
    response = request(method, url, **request_kwargs)
    assert response.status_code == expected_status_code
    if expected_status_code in (301, 302) and expected_location:
        if callable(expected_location):
            assert expected_location(response.headers["location"])
        else:
            assert response.headers["location"] == expected_location
    if is_behind_cdn:
        if is_cdn_cache_miss(response):
            response2 = request(method, url, **request_kwargs)
            assert response2.status_code == expected_status_code
            assert is_cdn_cache_hit(response2)
            if expected_status_code == 200:
                assert response2.content == response.content
            elif expected_status_code in (301, 302):
                if expected_location:
                    if callable(expected_location):
                        assert expected_location(response2.headers["location"])
                    else:
                        assert response2.headers["location"] == expected_location
                else:
                    assert response2.headers["location"] == response.headers["location"]
        else:
            assert is_cdn_cache_hit(response)
    else:
        assert "public" in response.headers["Cache-Control"]
        assert ("max-age" in response.headers["Cache-Control"]) or (
            "s-maxage" in response.headers["Cache-Control"]
        )
    return response