Skip to content

feat: add query string sort option for cache key generation#751

Open
IndraGunawan wants to merge 3 commits intodarkweak:masterfrom
IndraGunawan:sort-query
Open

feat: add query string sort option for cache key generation#751
IndraGunawan wants to merge 3 commits intodarkweak:masterfrom
IndraGunawan:sort-query

Conversation

@IndraGunawan
Copy link
Copy Markdown

This PR introduces a new configuration option sort_query to the cache key generation process.

Currently, Souin creates separate cache entries for the same resource if the query string parameters are in a different order (for example /video/1?a=1&b=2 and /video/1?b=2&a=1). With sort_query enabled, Souin will alphabetically sort the query parameters by name, and parameters with the same name will be sorted by their values, ensuring a consistent cache key.

Inspired by https://developers.cloudflare.com/cache/advanced-configuration/query-string-sort/

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 6, 2026

Deploy Preview for teal-sprinkles-4c7f14 canceled.

Name Link
🔨 Latest commit 942fc98
🔍 Latest deploy log https://app.netlify.com/projects/teal-sprinkles-4c7f14/deploys/69d513f5512f380008ed83f4

Comment thread context/key.go
Co-authored-by: darkweak <darkweak@protonmail.com>
@darkweak darkweak added the Next release It will be in the next release label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Next release It will be in the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants