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

Support better configuration encoding strategies for the URL #271

Open
bripkens opened this issue Dec 21, 2023 · 1 comment
Open

Support better configuration encoding strategies for the URL #271

bripkens opened this issue Dec 21, 2023 · 1 comment

Comments

@bripkens
Copy link
Member

bripkens commented Dec 21, 2023

Why

We currently have to lock certain features behind the URL shortener. This is because the configuration within the URL can become too long and can thus exhaust Vercel's URL length limitations.

Ideas

We currently encode the configuration using jsurl2 and put it into the URL hash (which does not get sent to the server). This is quite verbose. An alternative could be to compress the config and then to place base64 into the URL.

This has additional benefits:

  • We no longer need to use the URL hash for the config
  • We can unlock all the features even for all URLs
  • We can remove some hacks in the code related to URL hashes

Size Research

The following is a quick check showing the character count differences between

  • the actual collector configuration without any encoding
  • the overhead that jsurl2 adds
  • the resulting character count when using gzip and base64
$ wc -c config.yaml config.yaml.jsurl2 config.yaml.gzip.base64
    9480 config.yaml
   11015 config.yaml.jsurl2
    2809 config.yaml.gzip.base64

Compression API Research

Potential issue: Currently the URL handling is fully synchronous. Some of the APIs linked in these articles would make the process asynchronous.

@mmanciop
Copy link
Member

We should not break backwards compatibility though, neither for short links nor for full-path ones, so we probably need an alternative path scheme for the new strategy.

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

No branches or pull requests

2 participants