implementation of local cache