Simulates the behavior of cache memory.