Basic cache implementation.