Closed nmondal closed 1 month ago
After much deliberation, it is pointless. In fact it has negative impact. Consider the following.
A token got expired. Great. Now cache has expired token and all call using that token would fail, because of expiry. So it fails fast.
Now suppose we remove it. We do not know whether the data store would have it, if it does - in any case we need to connect to the data store to actually fetch the stuff - and still fail because of token not found or token expiry. So we fail slow.
Therefore, this is a bad idea. The current behavior is good enough.
Something like the token cache for Auth. Of course JDBC connections are already implemented like this.