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

Compress URL params #57

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

Compress URL params #57

wants to merge 2 commits into from

Conversation

Akeboshiwind
Copy link
Collaborator

  • Uses lz-string to compress url params.
  • Backwards compatible using a new uri-version parameter

I tested out both lz-string and fflate.
Using gzip with fflate is way smaller than lz-string in around the same time, but when I tried to url encode the output it 10x the output size 😅.

Copy link
Contributor

@johantonelli johantonelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm :shipit:

@@ -17,26 +18,34 @@

;; 'my.app.thing :trace ;; Some namespaces you might want detailed logging

(defn- decompress-params [{:keys [uri-version] :as query-params}]
(let [decompress (case uri-version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be more intuitive to be an if if there's only one case with a default (I know, I'm a hypocrite)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it like this because I’ve changed the uri format enough times to know I’ll change it again 😅

@mpisanko mpisanko force-pushed the main branch 3 times, most recently from 83ca72e to a51ddc1 Compare January 23, 2025 17:31
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.

2 participants