Get freshness read file - #20
Conversation
to know if cache entry is new, found, or expired
|
@fellou89 Thanks for your PR but I think I don't understand the porpoise of this change:
|
|
I'm working on an authentication module that validates a client access token and a refresh access token. It needs to cache the authenticated identity that comes back from the auth endpoint. That's where the I added the freshness check to cut some time out of the auth process. If an access token cache entry is no longer fresh (has gone past the configured max-age), then I want to return a 401 immediately, without having to incur the additional time it takes to validate the (expired) token on the auth endpoint. |
|
I don't think this is a good change, it doesn't add a new feature to the plugin nor it fixes a bug. You can develop your plugin without this changes. Instead of using the |
GetFreshness exported function to check if file has expired
Read function to get responses stored in cache