Basic implementation of the cached reducer