Fix Python – Is there a Python caching library?


Asked By – Stavros Korokithakis

I’m looking for a Python caching library but can’t find anything so far. I need a simple dict-like interface where I can set keys and their expiration and get them back cached. Sort of something like:

cache.get(myfunction, duration=300)

which will give me the item from the cache if it exists or call the function and store it if it doesn’t or has expired. Does anyone know something like this?

Now we will see solution for issue: Is there a Python caching library?


This question is answered By – Corbin March

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0