This is done because of inheritance.
Just imagine you have a resource bundle for de_DE (already existing)
Now you provide an additional resource bundle for de (which was not there 
before).
This requires de_DE to also be invalidated, because it get's a new parent.

In case you have a good idea on how to optimize that even further, please 
create a Pull request.

Thanks,
Konrad

> On 27 Apr 2016, at 12:18, Ankit Agarwal <anaga...@adobe.com> wrote:
> 
> Hi All,
> With the fix of bug [0], sling discards only  those ResourceBundle which 
> becomes invalid.
> But as per [1], if path of the translation which has been changed does not 
> come under the "languageRootPaths" that are already cached, cache of resource 
> bundle is invalidated. Hence causing the reloading of all resource bundle.
> Can someone please explain, why this behavior is followed. Is there any fail 
> case, if we do not invalidate cache if path of the translation does not come 
> under "languageRootPaths".
> 
> [0] https://issues.apache.org/jira/browse/SLING-4795
> [1] 
> https://github.com/apache/sling/blob/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java#L191
> 

Reply via email to