private static boolean evaluate(ProxyContext context,
                                    ResourceDescriptor resource,
                                    Map<String, List<Rule>> rules,
                                    Map<String, Boolean> cache) {

        if (resource != null && !resource.isFolder()) {
            resource = resource.getParent();
        }

        if (resource == null) {
            return true;
        }

        String folderUrl = ruleUrl(resource);
        Boolean evaluated = cache.get(folderUrl);

        if (evaluated != null) {
            return evaluated;
        }

        evaluated = evaluate(context, resource.getParent(), rules, cache);

        if (evaluated) {
            List<Rule> folderRules = rules.get(folderUrl);
            evaluated = folderRules == null || RuleMatcher.match(context, folderRules);
        }

        cache.put(folderUrl, evaluated);
        return evaluated;
    }
Key is updated time from the metadata. Value is decoded map (folder path, list of rules).
server/src/main/java/com/epam/aidial/core/server/service/RuleService.java