Uploaded image for project: 'Cache Modules'
  1. Cache Modules
  2. MGNLCACHE-256

Allow for excluded directories in LightModuleChangesFlushPolicy

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • 5.9.4
    • cache core
    • None
    • 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.

        Acceptance criteria

              Unassigned Unassigned
              rgange Richard Gange
              DeveloperX
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:

                  Task DoD