Here is the scenario,
But when i run the proxyC the cache entries created by proxyA(org_env_proxyA_AB) and proxyB(org_env_proxyB_AB) are still active.
As per documentation invalidateCache only considers keyFragment when "PurgeChildEntries" is set to true. Please advice.
Proxy A:(cacheKey : org_env_proxyA_AB , keyFragment =AB)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ResponseCache async="false" continueOnError="false" enabled="true" name="Response-Cache"> <DisplayName>Response Cache-1</DisplayName> <Properties/> <CacheKey> <Prefix/> <KeyFragment ref="holdsValAB" type="string"/> </CacheKey> <Scope>Application</Scope> <ExpirySettings> <ExpiryDate/> <TimeOfDay/> <TimeoutInSec ref="">600</TimeoutInSec> </ExpirySettings> <CacheResource>testCache</CacheResource> </ResponseCache>
Proxy B: (cacheKey : org_env_proxyB_AB , keyFragment =AB)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ResponseCache async="false" continueOnError="false" enabled="true" name="Response-Cache"> <DisplayName>Response Cache-1</DisplayName> <Properties/> <CacheKey> <KeyFragment ref="holdsValAB" type="string"/> </CacheKey> <Scope>Apllication</Scope> <ExpirySettings> <ExpiryDate/> <TimeOfDay/> <TimeoutInSec ref="">600</TimeoutInSec> </ExpirySettings> <CacheResource>testCache</CacheResource> </ResponseCache>
Proxy C:(keyFragment =AB) : will this still consider scope when "PurgeChildEntries" is set to true?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <InvalidateCache name="Invalidate-Cache-1" enabled="true" continueOnError="false" async="false"> <DisplayName>Invalidate Cache-1</DisplayName> <Properties/> <CacheKey> <KeyFragment ref="holdsValAB"/> </CacheKey> <Scope>Apllication</Scope> <CacheResource>searchContract</CacheResource> <PurgeChildEntries>true</PurgeChildEntries> </InvalidateCache>
In short I want to purge the cache entries based on the keyFragment only(keyFragment =AB). prefix/scope should not be considered while purging/deleting the cache entries.
Will this meet your requirement
- Use Global scope
- Set proxy name in prefix
- Use holdsValAB in KeyFragment
- Set PurgeChildEntries to true in invalidate policy
So as per your comments:
1. We have CommonCache Resource used by all proxies(A,B and C)
2. Proxy A : keyFragment :AB(this will change for each new entry passed as input parameter) , Prefix: PFA , Scope: Global
so the Cachekey will be : PFA_AB ( Prefix overrides scope).
3. Proxy B : keyFragment :AB(this will change for each new entry passed as input parameter) , Prefix: PFB , Scope: Global
so the Cachekey will be : PFB_AB ( Prefix overrides scope).
4. Proxy C : Just has invalidate Cache pointing to same Cache Resource .
keyFragment :AB(this will change for each new entry passed as input parameter) , Prefix: PFC , Scope: Global
so the Cachekey will be : PFC_AB ( Prefix overrides scope).
So as per you if I have PurgeChildEntries set to true in proxyC with invalidate Cache it will delete all the entries with KeyFragment AB created by Proxies A and B. if so , this is not happening.
Also, In order to differentiate the entries made by Praxy A and B I am using Proxy specific Prefix(with scope Global it will not be possible as it overrides other proxy entries) and also I don't want to use different cache resources as an alternate.