Implemented caching for all data types.