using cache instead of in memory