Skip to content
Discussion options

You must be logged in to vote

@zrachlin I would think you might want to cache the external APIs' results, not necessarily the responses from your API.

Otherwise, someone could, for example, use a stale/invalid authentication token, and still receive the response, because that old token input with the extra data is still on the cache.

To use aiocache you would benefit from async functions more. Otherwise you would need custom tricks.

But if you use normal def functions you could probably use a normal Redis Python package and do it yourself. Redis has fields with TTL, so you can have stale data invalidation easily. It shouldn't be that hard to implement.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tiangolo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
3 participants
Converted from issue

This discussion was converted from issue #651 on February 28, 2023 11:31.