CacheStrategy basically controls the re-synchronization of metadata inside a FileObject between multiple calls. FileObject decides when to update its view of the world.
It will call refresh() each time you resolve , or it will call refresh() before each call to the FileObject method (via the OnCallRefreshFileObject decorator) or never automatically.
refresh() sets the FileObject state to a detached state most of the time, so it is read fresh when the next action is checked using attach() .
This is mainly due to metadata, such as attributes and children, I donβt think there is any file system provider that actually caches the content.
FilesCache actually responsible for caching instances of FileObject inbetween resolveFile() calls. Thus, if you manage to resolve or go to the same file, you will also get the same instance of the Java object (if you are not using NullFilesCache or some entries LRUFilesCache expired in the LRUFilesCache cache).
source share