Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

Problem with Redis keys on distributed systems #2

@OscarRomaFever

Description

@OscarRomaFever

In some large, distributed projects that run across different machines, the order in which FastAPI endpoint routes are loaded can vary. This can cause the keys generated for each pod to have different values, leading to separate caches per machine. This is due to this code.

Would it be possible to change the way keys are generated, or at least allow users to change how they are generated?

I attach here a PR proposal for fastapi-limiter. Any other approach could be useful for us, like allowing the user to pass full generated key, instead of just rate_key.
Other option, that will not change the code of the project, is to create a method create_key for this line. This way, any user could be able to monkey_patch this method.

Thank you so much for forking the Fastapi-limiter repository and trying to keep it active. This is very helpful for many of us☺️.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions