a-luna / fastapi-redis-cache

A simple and robust caching solution for FastAPI that interprets request header values and creates proper response header values (powered by Redis)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] How to manually expire an entry ?

sorasful opened this issue · comments

Hi there,

I know that the keys are supposed to expire after some time, but I was wondering if there were some kind of mechanism to manually expire an entry ?

Thank you !

I don't have much experience with this project/package, but based on what I saw, they utilize regular key: value pairs to provide caching (see some key formatting rules in the docs: https://pypi.org/project/fastapi-redis-cache/#:~:text=two%20hours%22%7D-,Cache%20Keys,-Consider%20the%20/get_user).

My solution to manually invalidate/expire caching entry would be to delete the key by calling the Redis command itself.