How Memory Caching Works