Created cache which is aware of function with preimage.