royteeuwen opened a new pull request, #219: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/219
Backport of [SLING-12244](https://issues.apache.org/jira/browse/SLING-12244) to the 1.x maintenance branch, tracked as [SLING-13275](https://issues.apache.org/jira/browse/SLING-13275). Caches the result of `ResourceResolver.getParentResourceType(Resource)` in a per-resolver map keyed by resource path, avoiding repeated repository access for the same resource. The cache is cleared on `refresh()` alongside the existing `resourceTypeLookupCache`. Cherry-picked from master commit `3abb019`, released in Resource Resolver 2.0.0. It was never backported, so the 1.x line still resolves the parent resource type on every call. ### Note for reviewers This changes lookup semantics, not just performance: a `sling:resourceSuperType` change is no longer observed by an already-open resolver until `refresh()` is called. That is the same behaviour 2.x has shipped with since 2.0.0. ### Verification `mvn clean verify` on this branch: BUILD SUCCESS, 645 tests, 0 failures (adds `ResourceResolverImplTest#testGetParentResourceType`, which asserts the second lookup is served from the cache). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
