implements the local cache