Show community: async-caches (0.3 released!)

Hello everyone!

I’ve just released first version of async-caches :tada:


Its caching library that closely follows encode/databases, so it should play nice with Starlette. It’s API is reimplementation of django.core.cache, so its already familiar to developers making switch (like I me) :wink:

It implements three caching backends:

  • dummy - Dummy cache backend that doesn’t cache anything. Used to disable caching in tests.
  • locmem - Cache backend that stores data in thread’s memory. Lets you develop and test caching without need to setup and maintin cache server.
  • redis - Redis cache intended for use in actual deployments.

It’s already functional, but I still need to write docs for it.

Thanks!

1 Like

Fab! Another one in this area is https://aiocache.readthedocs.io/en/latest/
At some point we’ll def want to expand out the Starlette docs to include both of these.

1 Like

Yup, I’ve looked at that one but I just really wanted slice of Django cache… except async and in Starlette :joy:

Still, choice is awesome :muscle:

1 Like

Looks great, congrats @rafalp! The docs are very well-written and easy to follow.

Wanted to update this over the week but I’ve couldn’t find energy for that until now.

I’ve released version 0.2 that makes add(), touch() and get_or_set() API behave the same it does in Django.

I’ve also completed API reference page in docs: https://rafalp.github.io/async-caches/api/

1 Like

I’ve decided to betray the 100% compatibility with Django and release 0.3 that renames timeout argument to ttl (“time to live”) which is more correct. :wink:

1 Like

@rafalp I’m really digging how clean the API is. Is this project already used somewhere else? Also, I think when it’s ready/more stable it could be a great addition to the awesome-asyncio list. :slight_smile:

I’m not using this lib anywhere yet, but I am slowly reinventing Django moving Misago to Starlette, and I’ve been planning to use it here, together with auth tools, ORM, etc. ect.

1 Like