Darshan Hiranandani : Issue with Key Fragment in Cache Key for Populate Cache & Lookup Cache

Hi everyone,

I am Darshan Hiranandani, having an issue with using the ref attribute in the KeyFragment for caching JWTs based on id and role. Below is a code snippet I am working with, but the dynamic values for id and role are not being picked up correctly in the cache key.

Here is the code I’m using (with some details truncated for brevity):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache continueOnError="false" enabled="true" name="PC-XXXX">
<CacheResource>JWT</CacheResource>
<Source>generated_jwt</Source>
<Scope>Exclusive</Scope>
<CacheKey>
<KeyFragment ref="Id"/>
<KeyFragment ref="role"/>
</CacheKey>
<ExpirySettings>
<TimeoutInSec>3600</TimeoutInSec>
</ExpirySettings>
</PopulateCache>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LookupCache continueOnError="false" enabled="true" name="LC-XXXXX">
<DisplayName>LC-XXXXX</DisplayName>
<CacheResource>JWT</CacheResource>
<AssignTo>generated_jwt</AssignTo>
<Scope>Exclusive</Scope>
<CacheKey>
<KeyFragment ref="Id"/>
<KeyFragment ref="role"/>
</CacheKey>
</LookupCache>

 

The problem I am facing is that the id and role values are not being dynamically inserted into the cache key as expected. Has anyone faced a similar issue or can suggest a possible solution? Is there a specific syntax or configuration I am missing for the ref attribute to work correctly?

Any help or insights would be greatly appreciated!

Thanks in advance!

Regards

Darshan Hiranandani

 

0 1 23
1 REPLY 1