简体   繁体   中英

How to Query the APIGee Cache

My Question: How can i query/list the contents of the cache.

So i have creates one cache from Management API->Environment Configuration. Then i created a api proxy with no target and attached populate cache policy to it. eg

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="populateBlacklistByIP">
    <DisplayName>populateBlacklistByIP</DisplayName>
    <FaultRules/>
    <Properties/>
    <CacheKey>
      <Prefix>CLIENTIP-</Prefix>
      <KeyFragment ref='request.queryparam.myvar'/>
    </CacheKey>
    <CacheResource>mycache</CacheResource>
    <Scope>Global</Scope>
<!-- no expiry -->
    <ExpirySettings>
        <TimeoutInSec>432000</TimeoutInSec>
    </ExpirySettings>

    <Source>request.queryparam.myvar</Source>
</PopulateCache>

Now i invoke the operation and get 200 ok back. But no way to check if the value made to cache or not.

Please help.

Got My Answer from digging through the documentation.

Ref: http://apigee.com/docs/api-services/content/persistence .

Read this from url above:

Cache versus Key/value map The PopulateCache policy does not persist cache entries. Entries are in memory until the configured expiration time. You can look up the value only until it expires.

One limitation is that you cannot find the list of keys that are currently in a cache.

When using KeyValueMap, the keys are persisted indefinitely. There are APIs available to retrieve the list of keys. There is no expiration time for the keys; you must explicitly delete them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM