Listing cache entries

Not applicable

I have this Populate Cache:

	<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="Populate-Cache-1">
    <DisplayName>Populate Cache-1</DisplayName>
    <Properties/>
    <CacheKey>
        <Prefix>posts</Prefix>
        <KeyFragment>id</KeyFragment>
        <KeyFragment ref="response.content"/>
    </CacheKey>
    <CacheResource>teste</CacheResource>
    <ExpirySettings>
        <TimeoutInSec>3600</TimeoutInSec>
    </ExpirySettings>
    <Source>cachedPosts</Source>
</PopulateCache>

I confess I am lost with all the naming and pattern to find out the entry that was created.

I am trying to get the entry like this:

GET

https://api.enterprise.apigee.com/v1/organizations/{{org_name}}/environments/{{env_name}}/caches/tes...

But I am getting a 404 response. What am I doing wrong?

I need to check the cache entry because I will create many entries and for testing purposes I want to create a cache entry and retrieve it, checking its content.

Solved Solved
0 3 1,535
1 ACCEPTED SOLUTION

Hi @danielgerep,

There is no management API available to get the cache entries. Moreover, you can use the Lookup Cache policy to fetch the cached data based on the cache key that was used in Populate Cache. These two policies go hand in hand to update/create and fetch cache entries.

Although even I would love to see a management API which could list down all cached entries for cache resource or global cache.

Hope this helps!

View solution in original post

3 REPLIES 3

Hi @danielgerep,

There is no management API available to get the cache entries. Moreover, you can use the Lookup Cache policy to fetch the cached data based on the cache key that was used in Populate Cache. These two policies go hand in hand to update/create and fetch cache entries.

Although even I would love to see a management API which could list down all cached entries for cache resource or global cache.

Hope this helps!

Hi @Mohammed Zuber,

Thank you for the information.

Can you please tell me, according to my xml above, which would be the cache key?

Thanks!

Hi @danielgerep,

In above the same cachekey element as you have used in Populate cache.

<CacheKey>
        <Prefix>posts</Prefix>
        <KeyFragment>id</KeyFragment>
        <KeyFragment ref="response.content"/>
    </CacheKey>

Although, using "response.content" is not kind of recommended as the cache key length is restricted to 2 KB.

Please check the documentation for caching here.

https://docs.apigee.com/api-services/reference/optimize-performance-using-cache

This explains all caching policies available in Apigee.

Hope that helps!