async def get_target(config, url):
    """ Given a URL, get the webmention endpoint """

    previous = config.cache.get(
        'target', url, schema_version=SCHEMA_VERSION) if config.cache else None

    headers = previous.caching if previous else None

    request = await utils.retry_get(config, url, headers=headers)
    if not request or not request.success:
        return previous

    if request.cached:
        return previous

    current = Target(request)

    if config.cache:
        config.cache.set('target', url, current)

    return current
Given a URL, get the webmention endpoint