Made caching functions cache config aware