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: lex-sort query args and arg transformer hook #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rhnvrm
Copy link
Member

@rhnvrm rhnvrm commented Mar 6, 2024

This commit introduces a new feature that enables the specification of specific query parameters to be used as the cache index key when creating a URI via a arg transformer hook.

For instance, it allows caching requests like GET /foo?mode=bar. The assumption is that users are aware of the query parameters that can be sent and that these parameters are utilized by the handler to modify the request. Consequently, even if the user includes additional irrelevant parameters like GET /foo?mode=bar&junk=xyz, the cache will still be utilized since the specified parameters are the key.

Also, we now lexicographically sort the query params so that cache cannot be busted by reordering the params.

@rhnvrm rhnvrm force-pushed the feat-arg-transformer-lex-sort branch from 803d284 to 61aca15 Compare March 6, 2024 19:15
This commit introduces a new feature that enables the specification
of specific query parameters to be used as the cache index key
when creating a URI via a arg transformer hook.

For instance, it allows caching requests like GET /foo?mode=bar. The
assumption is that users are aware of the query parameters that can
be sent and that these parameters are utilized by the handler to modify
the request. Consequently, even if the user includes additional
irrelevant parameters like GET /foo?mode=bar&junk=xyz, the cache will
still be utilized since the specified parameters are the key.

Also, we now lexicographically sort the query params so that cache
cannot be busted by reordering the params.
@rhnvrm rhnvrm force-pushed the feat-arg-transformer-lex-sort branch from 61aca15 to a2d7f0b Compare March 6, 2024 19:18
@rhnvrm rhnvrm requested a review from knadh March 6, 2024 19:18
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

Successfully merging this pull request may close these issues.

1 participant