-
Improvement
-
Resolution: Unresolved
-
Neutral
-
None
-
5.9.4
-
None
-
-
Empty show more show less
-
Yes
-
Yes
To reduce observation overhead it would be a nice improvement if the subdirectories within a light module could be excluded from the flush policy observation mechanism. Some light modules can have resources with with many files and deep hierarchies. Consider a node_modules directory.
One option is to use the same parameter defined in the properties file:
# Directories relative to magnolia.resources.dir which will be excluded from FileResourceOrigin observation. # Also see info.magnolia.resourceloader.file.FileSystemResourceOrigin#EXCLUDED_DIRECTORIES magnolia.resources.filesystem.observation.excludedDirectories=META-INF,WEB-INF,cache,docroot,logs,repositories,tmp
Since the class LightModuleChangesFlushPolicy is already using the parameter FileSystemResourceOrigin.RESOURCES_DIR_PROPERTY it might make sense to do something similar as what is being done in the class FileSystemResourceOrigin#buildExclusionsFilter().
Another option might be to make the class LightModuleChangesFlushPolicy configurable so that different exclusion directories could be used. For example if a excludedDirectories property is found in config then use that otherwise fallback to FileSystemResourceOrigin.EXCLUDED_DIRECTORIES.
Notes
FileSystemResourceOrigin.EXCLUDED_DIRECTORIES is currently private.