Play does not update on get, which is what I'd expect. Your workaround is how you solve that :)
Does Play's built-in cache do sliding expiration? If not, what's the best way or perhaps the easiest way?
-
12-07-2023 - |
سؤال
There's a method Cache.set( keyString, objectToPutInCache, timeout )
and I used it. It seems the timeout doesn't get reset every time the same object is retrieved from the cache with the same key.
If there's no way to implement this, what's the best way to do sliding expiration cache in Play framework?
I'm using Java.
UPDATE:
As a workaround, I'm currently calling Cache.set()
method again every time I successfully retrieve an object with the same key just to reset the expiration timeout.
المحلول
لا تنتمي إلى StackOverflow