Add caching function to Model