0

I'm trying to extend the TTL when the cache is about to expiry and if downstream service(from which i read the objects and load to cahce) is down.

I don't want to check if downstream service is down everytime as it will slow down us.

So can we access TTL in custom implementation of the Expiry?

1 Answers1

0

The ExpiryPolicy is used to give the duration. This duration is then added to the current time to know when the entry should be evicted. When this moment occurs, it's evicted.

You can't plug you own verification routine to the eviction mechanism.

If you need to refresh everything at a given time, you should just do it. It means, no expiration on anything. When the time comes, you just refresh all your entries, if the backend is up.

That should do the trick.

Henri
  • 5,551
  • 1
  • 22
  • 29