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.



Fab! Another one in this area is
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:

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

Hey @rafalp! I stumbled about your async-caches library again, and read again the caches backend issue on Starlette.

I realized that while async-caches provides a very neatly focused core API for performing cache operations, there might be some room left for higher-level caching ASGI utilities.

I just pushed a new repo, asgi-caches. It only contains docs for now (no code), but I’d be happy to hear anyone’s thoughts on the resulting API. Example usage here: encode/starlette#252 (comment).