Refactor cache_flush into get_assignment. Fill both caches upon one network fetch