added basic file caching.