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

feat(cache): Allow using in-memory compression dicts #510

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

theduke
Copy link

@theduke theduke commented Jan 11, 2025

This PR allows setting the compression dictionary used for headers in
pingora-cache from in-memory bytes instead of an external file through a new set_compression_dict_content function.

This is useful if the dict is already embedded in the binary, or is
retrieved from remote storage dynamically.

Also cleans up the code a bit by making the static private, moving the
initialisers to the same file and re-exporting them to keep the logic
contained, and by slightly simplifying the file loading code.

There is a small ordering change: the file now needs to be available at the time set_compression_dict_path() is called, rather than at the time HEADER_SERDE is first accessed, but that shouldn't cause any issues?

@theduke theduke force-pushed the cache-compression-set-from-memory branch from 85075f9 to 6cfe7e4 Compare January 11, 2025 08:36
This PR allows setting the compression dictionary used for headers in
`pingora-cache` from in-memory bytes instead of an external file.

This is useful if the dict is already embedded in the binary, or is
retrieved from remote storage dynamically.

Also cleans up the code a bit by making the constant private, moving the
initialisers to the same file and re-exporting them to keep the logic
contained, and by slightly simplifying the file loading code.
@theduke theduke force-pushed the cache-compression-set-from-memory branch from 6cfe7e4 to e7c01ef Compare January 11, 2025 08:40
@gumpt gumpt added the enhancement New feature or request label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants