file and memory cache using its own conditions