implemented app directory checks and a cache
set the cache directory