provides a generic way to cache any data.