tw_connect_to_cache function

Return a connection to be used for caching