Hey everyone!
So, I’ve been trying to implement time-based cache Python for a project, and I’m kinda stuck on the best way to do it. Like, I know about `@lru_cache` and stuff, but how do you add a time limit to it?
I’ve seen some folks use `datetime` or `time` modules, but idk if that’s the cleanest way. Anyone got tips or examples on how to implement time-based cache Python without overcomplicating things?
Also, what’s the deal with libraries like `cachetools`? Are they worth using, or should I just roll my own solution?
Thanks in advance! 🙌
So, I’ve been trying to implement time-based cache Python for a project, and I’m kinda stuck on the best way to do it. Like, I know about `@lru_cache` and stuff, but how do you add a time limit to it?
I’ve seen some folks use `datetime` or `time` modules, but idk if that’s the cleanest way. Anyone got tips or examples on how to implement time-based cache Python without overcomplicating things?
Also, what’s the deal with libraries like `cachetools`? Are they worth using, or should I just roll my own solution?
Thanks in advance! 🙌
