complete the function of cache matric