Skip to content

Client-side caching doesn't work when using bytes keys #3618

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
jnrbsn opened this issue Apr 25, 2025 · 1 comment
Open

Client-side caching doesn't work when using bytes keys #3618

jnrbsn opened this issue Apr 25, 2025 · 1 comment

Comments

@jnrbsn
Copy link

jnrbsn commented Apr 25, 2025

When using bytes objects as keys, client-side caching doesn't work, because when trying to invalidate the cache, it unconditionally decodes bytes to str objects. This should probably be the other way around (i.e. encode all str keys as utf-8 and only store bytes keys in the cache). This would allow the use of str and bytes keys interchangeably for the vast majority of cases, unless someone is interchangeably using str keys and non-utf-8-encoded bytes keys, in which case they should probably stick with one or the other.

@petyaslavova
Copy link
Collaborator

Hi @jnrbsn , thank you for pointing this out! We'll have a look at this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants