Use a simple cache for big speedup.