def set_cache(cache, old_cache):
    """
    Use ``cache`` as the new cache for all open requests.
    Copies keys from old cache, and deletes them from the old cache.
    """
    for key in list(old_cache.keys()):
        cache[key] = old_cache[key]
        del old_cache[key]
    return cache
