Simple in-memory cache implementation