basic sync logic implemented with cache of files