Skip to content

Async redis-py client does not support client-side caching / key tracking #3916

@valrusso

Description

@valrusso

I noticed that while the synchronous redis-py client supports client-side caching using Redis tracking (CLIENT TRACKING), the async client (redis.asyncio) does not provide this functionality.

This makes it difficult to implement local caching in async applications without manually managing cache invalidation and pub/sub listeners. Ideally, the async client would support the same cache tracking features as the sync client, allowing:

Automatic invalidation of local cache when keys are updated or deleted on the server.

Efficient use of Redis client-side caching in async applications without custom workarounds.

I understand this might be due to the complexity of implementing tracking with asyncio, but it would be extremely useful to have feature parity between the sync and async clients.

Use case example:

I want to maintain a local cache in an async web server.

I want to automatically react if a key is deleted or updated on the Redis server.

Currently, I need to manually implement pub/sub listeners and cache management, which is error-prone and adds overhead.

It would be great if the async client could implement native client-side caching support, similar to the synchronous client.

Thank you for considering this feature!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions