Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Can't LookupCache between subsequent requests

Hi,

I'm trying to get the populate / lookup cache policies working and running into some trouble.

For reference this is my current setup:

LookupCache Policy

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LookupCache async="false" continueOnError="false" enabled="true" name="LC-STSResponse">
    <DisplayName>LC-STSResponse</DisplayName>
    <Properties/>
    <CacheKey>
        <KeyFragment>sts</KeyFragment>
        <KeyFragment>AccessKeyId</KeyFragment>
        <!--<KeyFragment ref="iam-role-arn"/>-->
    </CacheKey>
    <Scope>Proxy</Scope>
    <AssignTo>sts.AccessKeyId</AssignTo>
</LookupCache>

 

PopulateCache Policy

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="PC-STSResponse">
    <DisplayName>PC-STSResponse</DisplayName>
    <Properties/>
    <CacheKey>
        <KeyFragment>sts</KeyFragment>
        <KeyFragment>AccessKeyId</KeyFragment>
        <!--<KeyFragment ref="iam-role-arn"/>-->
    </CacheKey>
    <Scope>Proxy</Scope>
    <ExpirySettings>
        <TimeoutInSeconds>300</TimeoutInSeconds>
    </ExpirySettings>
    <Source>sts.AccessKeyId</Source>
</PopulateCache>

 

SharedFlow

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SharedFlow name="default">
    <Step>
        <Name>LC-STSResponse</Name>
    </Step>
    <Step>
        <Name>KVM-GetAWSKeys</Name>
    </Step>
    <Step>
        <Name>AM-AWSConnection</Name>
    </Step>
    <Step>
        <Name>AM-AWS-Sigv4-Request</Name>
    </Step>
    <Step>
        <Name>STS-AssumeRole</Name>
    </Step>
    <Step>
        <Name>EV-STSResponse</Name>
    </Step>
    <Step>
        <Name>PC-STSResponse</Name>
    </Step>
    <Step>
        <Name>LC-STSResponse</Name>
    </Step>
</SharedFlow>

 

Basically I can retrieve a value from my cache if I LookupCache right after I Populate cache in the same request. But when I try to LookupCache at the start of my flow it will never find a cached value.

I've tried both shared cache & environment cache, I've tried a variety of CacheKeys/Prefixes/Scopes, various TimeoutInSeconds expirations. 

When I trace it always shows cachehit=false on the first LookupCache policy I'm trying to get to retrieve my value from a previous request.

It doesn't seem to matter if I make 2 requests or 10 requests, I never see a value come back in my subsequent call.

There are a variety of similar questions here on this topic, and I think I've been through most of them, but I haven't been able to spot what I'm doing wrong from other community posts or through my own effort reading Apigee Edge documentation.

I'd really appreciate any tips someone could offer.

Thanks,

Jared

 

 

0 1 154
1 REPLY 1
Top Solution Authors