Add match memory cache for most functions