I want to serve the data from the cache without even hitting the backend if it is somewhat fresh. I see two possible way os doing this:
1) Check when item was added to memory cache and serve if fresh. I do however not see anyway of checking when item was added to the cache
2) Use mem cache in TTL mode with short time span. This way I could just serve the item form cache if present. But I don't see any way of putting memory cache into TTL mode without the disk cache doing the same which I do not want.
What am I missing here?
I just noticed that I am able to set TTL on the mem cache like this: memoryCache.setTtl(true) but that the method is deprecated.
I want to serve the data from the cache without even hitting the backend if it is somewhat fresh. I see two possible way os doing this:
1) Check when item was added to memory cache and serve if fresh. I do however not see anyway of checking when item was added to the cache
2) Use mem cache in TTL mode with short time span. This way I could just serve the item form cache if present. But I don't see any way of putting memory cache into TTL mode without the disk cache doing the same which I do not want.
What am I missing here?
I just noticed that I am able to set TTL on the mem cache like this: memoryCache.setTtl(true) but that the method is deprecated.