How can we set cache life as infinite. My requirement is i dont want my cache to get expired. How can i do that?

Not applicable
 
0 12 334
12 REPLIES 12

@Harsht Jain

Have you tried below?

<ExpirySettings> <TimeoutInSec>-1</TimeoutInSec> </ExpirySettings>

No its not working. Can you suggest some other solution please

@Sunandita Dam , -1 works in the case of KVM policy, I am not sure about response cache / cache policies.

@Harsht Jain :

We can give the expirySettings as below.

"expirySettings": { "expiryDate": { "value": "12-01-2999" }

@Amar.Nekkanti , Thank you for answer, @Harshit Jain It should work & it will be great workaround till we figure out the right way to do same. Ideally, We need something like -1 suggested by @Sunandita Dam . @sribalaji , @tskumar@apigee.com Any insights into this query ? Thank you.

@Harshit Jain Could you please try with setting the TimeoutInSec as 0.

Also, will my cache value gets expires if my server gets restart?

if MP gets restarted then in-memory cache entries will be erased and data will be looked-up from persistent store(apigee cassandra) .

@Harshit Jain if MP gets restarted then in-memory cache entries will be erased and data will be looked-up from persistent store(apigee cassandra) .

@Harshit Jain if MP gets restarted then in-memory cache entries will be erased and data will be looked-up from persistent store(apigee cassandra) .

@Harshit Jain , Does TimeoutInSec 0 resolved your query ? If yes, Please click on accept link below the answer.

Not applicable

Hi @Harshit Jain,

Could you elaborate your use case? Though you have sort of solution of getting Cache with infinite time, but pl note that low hit ratio may have negative impact on overall performance of system. Cache has in-built mechanism to remove oldest entry on reaching limit.

Have you considered KeyValueMap? This looks better solution for such scenario.

Cheers,

Rajesh Doda