Hi, When i populate a cache in one request and lookup the value from a second request, the cache is not returning my value, here is the detail…
I have two proxy endpoints “/test1” and “/test2”,
“/test1” has this flow…
use JS to set two variables,
populate the cache with the key/value from the js variables,
lookup the value for the same key.
This works perfectly.
“/test2” has this flow… use JS to set two variables,
lookup the value for the same key,
this does not work when calling “/test1” then “/test2” directly afterwards
Here is my JS policy used on both…
context.setVariable('myscope.myvariable', "1");
context.setVariable('myscope.mycachekey', "abc");
Here is my populate cache policy used in “/test1”
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="Populate-Test-Cache">
<DisplayName>Populate Test Cache</DisplayName>
<Source>myscope.myvariable</Source>
<CacheResource>test</CacheResource>
<CacheKey>
<KeyFragment ref="myscope.mycachekey"/>
</CacheKey>
<Scope>Global</Scope>
<ExpirySettings>
<TimeoutInSec>99999</TimeoutInSec>
</ExpirySettings>
</PopulateCache>
And Here is my lookup cache policy used in both
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LookupCache async="false" continueOnError="false" enabled="true" name="Lookup-Cache-Test-1">
<DisplayName>Lookup Cache Test 1</DisplayName>
<CacheResource>test</CacheResource>
<Properties/>
<CacheKey>
<KeyFragment ref="myscope.mycachekey"/>
</CacheKey>
<Scope>Global</Scope>
<AssignTo>myscope.cachedvariable</AssignTo>
</LookupCache>
The result is that when i…
GET to “test1” i can see “myscope.cachedvariable” is set to 1 after the lookup
GET to “test2” i cannot see “myscope.cachedvariable” cachehit is set to false
I can see that the cachekey used in both lookups is “myorgtest__dev____abc”
Any ideas why this might not be working?
