Add configurable caching

fix #1109