Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Compression support #222

Open
buinauskas opened this issue Aug 21, 2024 · 3 comments
Open

Compression support #222

buinauskas opened this issue Aug 21, 2024 · 3 comments

Comments

@buinauskas
Copy link

buinauskas commented Aug 21, 2024

Hello, before I begin, thank you for an excellent library!

Recently, in one of our services, we started caching more and have reached maximum available memory, meaning that Redis will evict old keys and our cache-hit ratio suffers.

The async Redis cache stores data using JSON format. It's not the most compact format, and there's little to do with our underlying data structures.

Could compression be supported before caching the underlying data as an opt-in? I am willing to implement it instead of hacking something in our project.

I was planning on using https://crates.io/crates/async-compression and its available encoders.

Thanks!

@jqnatividad
Copy link
Contributor

Hi @buinauskas , if you're still planning on implementing this? If so, what compression algorithm are you thinking of using?

@buinauskas
Copy link
Author

I would consider adding this if the author approves it. I would've considered using gzip or lz4, they provide excellent compression for JSON strings.

@jqnatividad
Copy link
Contributor

+1 on this feature as I think it will greatly improve cache hit ratio, more than making up for the compression/decompression overhead.

Hopefully, if you do decide to go forward @buinauskas , that you do it for the other stores as well and not just the Redis store.

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

No branches or pull requests

2 participants